From 09808c49f2a5cd5cb38b1e90de37a4dc485c7fbe Mon Sep 17 00:00:00 2001
From: lnn19986213 <1667908750@qq.com>
Date: Fri, 22 Dec 2023 14:58:08 +0800
Subject: [PATCH] gx
---
README.md | 3 +--
src/pagesA/my/logOut.vue | 4 +--
src/pagesC/Login/Login.vue | 55 +++++++++++++++++++++++++++++++++-----
src/request/interface.js | 6 ++---
4 files changed, 55 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index 29bfe2f..79f3abc 100644
--- a/README.md
+++ b/README.md
@@ -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新增路由
diff --git a/src/pagesA/my/logOut.vue b/src/pagesA/my/logOut.vue
index fe54714..eab9d9d 100644
--- a/src/pagesA/my/logOut.vue
+++ b/src/pagesA/my/logOut.vue
@@ -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 => {
diff --git a/src/pagesC/Login/Login.vue b/src/pagesC/Login/Login.vue
index 05cfa2d..f79c415 100644
--- a/src/pagesC/Login/Login.vue
+++ b/src/pagesC/Login/Login.vue
@@ -30,6 +30,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -48,8 +62,8 @@
-
+
忘记密码?
@@ -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;
diff --git a/src/request/interface.js b/src/request/interface.js
index 279a254..51142e7 100644
--- a/src/request/interface.js
+++ b/src/request/interface.js
@@ -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)