This commit is contained in:
lnn19986213 2023-12-22 14:58:08 +08:00
parent 21060ba15d
commit 09808c49f2
4 changed files with 55 additions and 13 deletions

View File

@ -22,6 +22,5 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
### 山海万象版本 ### 山海万象版本
### 新增pages/pageHome/shwxLogin.vue ### 新增pages/pageHome/shwxLogin.vue
### request/interface.js里的401判断指向shwxLogin.vue ### request/interface.js里的401判断指向shwxLogin.vue
### my/logout.vue里的退出登录指向shwxLogin.vue
### 小程序版本要改回login.vue ### 小程序版本要改回login.vue
### 隐藏my里面的退出登录
### pages.json新增路由

View File

@ -20,8 +20,8 @@
this.http.request('/auth/logout', {}, "GET").then(res => { this.http.request('/auth/logout', {}, "GET").then(res => {
if (res.code == 200) { if (res.code == 200) {
uni.redirectTo({ uni.redirectTo({
url: "/pages/pageHome/shwxLogin", url: "/pages/pageHome/shwxLogin", //h3
// url: '/pagesC/Login/Login' // url: '/pagesC/Login/Login' //
}) })
} }
}).catch(e => { }).catch(e => {

View File

@ -30,6 +30,20 @@
<u--input type="password" placeholder="请输入密码" border="bottom" clearable v-model="userInfo.pasw"> <u--input type="password" placeholder="请输入密码" border="bottom" clearable v-model="userInfo.pasw">
</u--input> </u--input>
</u-form-item> </u-form-item>
<u-form-item prop="imgCode" ref="item1" class="data_itm" v-if="tab == 0">
<u-row justify="space-between" gutter="10" customStyle="width: 100%">
<u-col span="6">
<u--input placeholder="请输入验证码" border="bottom" clearable v-model="userInfo.imgCode">
</u--input>
</u-col>
<u-col span="6">
<div style="width: 100%; height: 40px;" @click="getImgFile()">
<img :src="imgFile" style="height: 100%; width: 100%" />
</div>
</u-col>
</u-row>
</u-form-item>
<u-form-item prop="phone" ref="item1" class="data_itm" v-if="tab == 1"> <u-form-item prop="phone" ref="item1" class="data_itm" v-if="tab == 1">
<u--input placeholder="请输入手机号" border="bottom" clearable v-model="userInfo.phone"></u--input> <u--input placeholder="请输入手机号" border="bottom" clearable v-model="userInfo.phone"></u--input>
@ -48,8 +62,8 @@
<u-button text="登录" size="large" throttleTime=1000 color="#99241B" @click="login()"> <u-button text="登录" size="large" throttleTime=1000 color="#99241B" @click="login()">
</u-button> </u-button>
<u-gap height="12"></u-gap> <u-gap height="12"></u-gap>
<u-button v-if="isWx" text="手机号快捷登录" size="large" throttleTime=1000 color="#99241B" open-type="getPhoneNumber" <u-button v-if="isWx" text="手机号快捷登录" size="large" throttleTime=1000 color="#99241B"
@getphonenumber="getPhoneNumber" :plain="true"> open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" :plain="true">
</u-button> </u-button>
<view class="other_op"> <view class="other_op">
<text @click="goRemeber">忘记密码</text> <text @click="goRemeber">忘记密码</text>
@ -71,6 +85,7 @@
pasw: null, pasw: null,
phone: null, phone: null,
code: null, code: null,
imgCode: null,
}, },
rules: { rules: {
'number': [{ 'number': [{
@ -100,6 +115,11 @@
message: '请填写验证码', message: '请填写验证码',
trigger: ['blur'] trigger: ['blur']
}], }],
'imgCode': [{
required: true,
message: '请填写验证码',
trigger: ['blur']
}],
}, },
tab: 0, tab: 0,
load: false, load: false,
@ -113,10 +133,30 @@
phone: '', phone: '',
jscode: '', jscode: '',
}, },
isWx: false isWx: false,
imgFile: '',
imgKey: '',
}; };
}, },
onLoad() {
this.getImgFile()
},
methods: { methods: {
getImgFile() {
//
this.http.request('/auth/getCodes', {}, "GET").then(res => {
if (res.code == 200) {
this.imgFile = res.data.captchaImg
this.imgKey = res.data.captchaKey
}
}).catch(e => {
this.load = false
uni.showToast({
title: e.data.message,
icon: "none",
});
})
},
pwdLog() { pwdLog() {
this.tab = 0 this.tab = 0
this.$refs.loginForm.clearValidate() this.$refs.loginForm.clearValidate()
@ -219,6 +259,8 @@
if (this.tab == 0) { if (this.tab == 0) {
this.load = true this.load = true
this.http.request('/auth/loginByPwd', { this.http.request('/auth/loginByPwd', {
code: this.userInfo.imgCode,
captchaKey: this.imgKey,
phone: this.userInfo.number, phone: this.userInfo.number,
pwd: this.userInfo.pasw pwd: this.userInfo.pasw
}, "POST").then(res => { }, "POST").then(res => {
@ -311,7 +353,8 @@
::v-deep .u-form-item__body__right__message { ::v-deep .u-form-item__body__right__message {
margin-left: 10px !important; margin-left: 10px !important;
} }
::v-deep .u-button--plain.u-button--info{
::v-deep .u-button--plain.u-button--info {
width: 100px !important; width: 100px !important;
border: 0px !important; border: 0px !important;
height: 21px !important; height: 21px !important;

View File

@ -5,7 +5,7 @@
export default { export default {
config: { config: {
// baseUrl: "http://192.168.2.39:8080/h5/api", //俞燕红-小程序不能配跨域 // baseUrl: "http://192.168.2.29:8080/h5/api", //俞燕红-小程序不能配跨域
// baseUrl: "/pre", //俞燕红-跨域 // baseUrl: "/pre", //俞燕红-跨域
// baseUrl: "https://yxx.ydool.net/h5/api", //线上 // baseUrl: "https://yxx.ydool.net/h5/api", //线上
baseUrl: "/h5/api", //h5 baseUrl: "/h5/api", //h5
@ -104,8 +104,8 @@ export default {
}); });
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
// url: '/pagesC/Login/Login' // url: '/pagesC/Login/Login' //小程序跳转
url: '/pages/pageHome/shwxLogin' url: '/pages/pageHome/shwxLogin' //h5-山海万象跳转
}) })
}, 1200) }, 1200)