From eb49564ab17c6695d8928d5a63a57c58b3cfd79c Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 11 十二月 2024 18:21:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 h5/utils/service.js |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/h5/utils/service.js b/h5/utils/service.js
index b26180f..0539bd3 100644
--- a/h5/utils/service.js
+++ b/h5/utils/service.js
@@ -18,7 +18,7 @@
 				method: options.method || 'GET',
 				header: options.header || {
 					// 鏍规嵁瀹為檯鎺ュ彛璁捐 key 鍙� token 鎴栬�� authorization
-					dm_user_token: token,
+					dm_user_token: token || '',
 					"content-type": 'application/json'
 				},
 				success: (res) => {
@@ -26,17 +26,21 @@
 					// 鎺у埗鍙版樉绀烘暟鎹俊鎭�
 					uni.hideLoading()
 					// 鐧诲綍杩囨湡
-					if (data.code === 401) {
-						uni.navigateTo({
-							url: '/pages/staffLogin/login'
-						});
-					}
 					if (data.code !== 200) {
-						uni.showToast({
-							title: data.message,
-							icon: "none",
-							duration: 2000
+						setTimeout(() => {
+							uni.showToast({
+								title: data.message,
+								icon: "none",
+								duration: 2000
+							})
 						})
+						if (data.code === 500 || data.code === 5112) {
+							uni.clearStorageSync()
+							return uni.navigateTo({
+								url: '/pages/login/login'
+							})
+						}
+						return
 					}
 					resolve(data)
 					// return response.data
@@ -46,7 +50,7 @@
 					uni.showToast({
 						title: '璇锋眰鎺ュ彛澶辫触'
 					})
-					
+
 					// 杩斿洖閿欒娑堟伅
 					reject(err)
 					uni.hideLoading()

--
Gitblit v1.9.3