Selaa lähdekoodia

登录失效提示恢复

htc 5 päivää sitten
vanhempi
commit
e1fa0d21d8
1 muutettua tiedostoa jossa 12 lisäystä ja 12 poistoa
  1. 12 12
      http/index.js

+ 12 - 12
http/index.js

@@ -25,18 +25,18 @@ export const $http = (url, method, data, json, isloading=true) => {
 		}
 		
 		if (response?.data?.code === 401 || response?.data?.msg.indexOf('未授权') > -1 || response?.data?.msg.indexOf('重新登录') > -1) {
-			// return uni.showModal({
-			// 	title: '温馨提示',
-			// 	content:'当前登录已失效,是否返回重新登录',
-			// 	success: (res) => {
-			// 		if (res.confirm) {
-			// 			uni.clearStorageSync();
-			// 			uni.reLaunch({
-			// 				url: '/pages/login'
-			// 			})
-			// 		}
-			// 	}
-			// })
+			return uni.showModal({
+				title: '温馨提示',
+				content:'当前登录已失效,是否重新登录',
+				success: (res) => {
+					if (res.confirm) {
+						uni.clearStorageSync();
+						uni.reLaunch({
+							url: '/pages/login'
+						})
+					}
+				}
+			})
 		}
 		
 		// 请根据后端规定的状态码判定