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
### request/interface.js里的401判断指向shwxLogin.vue
### my/logout.vue里的退出登录指向shwxLogin.vue
### 小程序版本要改回login.vue
### 隐藏my里面的退出登录
### pages.json新增路由

View File

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

View File

@ -30,6 +30,20 @@
<u--input type="password" placeholder="请输入密码" border="bottom" clearable v-model="userInfo.pasw">
</u--input>
</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--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>
<u-gap height="12"></u-gap>
<u-button v-if="isWx" text="手机号快捷登录" size="large" throttleTime=1000 color="#99241B" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber" :plain="true">
<u-button v-if="isWx" text="手机号快捷登录" size="large" throttleTime=1000 color="#99241B"
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" :plain="true">
</u-button>
<view class="other_op">
<text @click="goRemeber">忘记密码</text>
@ -71,6 +85,7 @@
pasw: null,
phone: null,
code: null,
imgCode: null,
},
rules: {
'number': [{
@ -100,6 +115,11 @@
message: '请填写验证码',
trigger: ['blur']
}],
'imgCode': [{
required: true,
message: '请填写验证码',
trigger: ['blur']
}],
},
tab: 0,
load: false,
@ -113,10 +133,30 @@
phone: '',
jscode: '',
},
isWx: false
isWx: false,
imgFile: '',
imgKey: '',
};
},
onLoad() {
this.getImgFile()
},
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() {
this.tab = 0
this.$refs.loginForm.clearValidate()
@ -219,6 +259,8 @@
if (this.tab == 0) {
this.load = true
this.http.request('/auth/loginByPwd', {
code: this.userInfo.imgCode,
captchaKey: this.imgKey,
phone: this.userInfo.number,
pwd: this.userInfo.pasw
}, "POST").then(res => {
@ -294,11 +336,11 @@
},
onReady() {
this.$refs.loginForm.setRules(this.rules);
// #ifdef MP-WEIXIN
this.isWx = true
// #endif
// #ifndef MP-WEIXIN
//
this.isWx = false
@ -311,7 +353,8 @@
::v-deep .u-form-item__body__right__message {
margin-left: 10px !important;
}
::v-deep .u-button--plain.u-button--info{
::v-deep .u-button--plain.u-button--info {
width: 100px !important;
border: 0px !important;
height: 21px !important;

View File

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