From c136669b4990a5276e594425179e3a41a8fcf5b3 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期五, 23 八月 2024 17:01:05 +0800
Subject: [PATCH] feat:请求退单增加限制

---
 pages/login/userPassword.vue |   51 ++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/pages/login/userPassword.vue b/pages/login/userPassword.vue
index fff267a..67dcd43 100644
--- a/pages/login/userPassword.vue
+++ b/pages/login/userPassword.vue
@@ -77,6 +77,7 @@
 						scope: 'server'
 					})
 					.then(res => {
+						this.submitLoading = false
 						setToken(res.access_token);
 						setRefreshToken(res.refresh_token);
 						if (this.btnText == 0) {
@@ -89,20 +90,29 @@
 								//鏌ヨ鐢ㄦ埛璇︾粏淇℃伅骞跺偍瀛�
 								this.$reqGet('getUserEntity')
 									.then(res => {
-										this.$u.toast('鐧诲綍鎴愬姛');
-										this.setUserTabbar(res.data.type);
-										uni.setStorageSync('roleType', res.data.type);
-										uni.setStorageSync("userId", res.data.userId)
-										uni.setStorageSync("carNo", res.data.carNo)
-										setCustomerId(res.data.customerid);
-										setName(res.name);
-										uni.hideLoading();
-										//璺宠浆椤甸潰
-										this.$nextTick(() => {
-											redirectHome();
-										});
+                    this.$u.toast('鐧诲綍鎴愬姛');
+					this.submitLoading = false
+					this.getLoginInfo(); // 璁板綍鐧诲綍淇℃伅
+                    this.setUserTabbar(res.data.type);
+                    uni.setStorageSync('roleType', res.data.type);
+                    uni.setStorageSync("userId", res.data.userId)
+                    uni.setStorageSync("carNo", res.data.carNo)
+                    setCustomerId(res.data.customerid);
+                    setName(res.name);
+                    uni.hideLoading();
+                    if(res.data.forcePassword == 1) {
+                      uni.navigateTo({
+                        url: '/pages/login/resetPassword/resetPassword'
+                      })
+                    }else {
+                      //璺宠浆椤甸潰
+                      this.$nextTick(() => {
+                        redirectHome();
+                      });
+                    }
 									})
 									.catch(err => {
+										this.submitLoading = false
 										this.$u.toast('鐧诲綍寮傚父锛�');
 										console.log(err);
 									});
@@ -111,6 +121,7 @@
 								this.$u.toast(res.msg);
 							}
 						} else {
+							console.log('寰俊缁戝畾锛燂紵锛燂紵锛�')
 							uni.login({
 								success: res => {
 									if (res.code) {
@@ -118,6 +129,7 @@
 									}
 								}
 							});
+							this.submitLoading = false
 							if (uni.getStorageSync('bindcode')) {
 								this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('bindcode') },
 									'params').then(res => {
@@ -130,13 +142,22 @@
 									} else {
 										this.$u.toast(res.msg ? res.msg : '缁戝畾澶辫触');
 									}
+								}).finally(() => {
+									this.submitLoading = false;
 								});
 							}
 						}
-					})
-					.catch(e => {
+					}).catch(e => {
+						this.submitLoading = false
 						this.$u.toast(e);
 					});
+
+			},
+			//璁板綍鐧诲綍淇℃伅
+			getLoginInfo(){
+				this.$reqPost('setApplogonTime').then((res) => {
+				  	
+				})
 			}
 		}
 	};
@@ -148,4 +169,4 @@
 	.dengluBtn {
 		margin-top: 80rpx;
 	}
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.1