From 7298d5354963a88643a543b51b90192dc9fc934c Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 11 九月 2025 18:43:14 +0800
Subject: [PATCH] 最新版本541200007
---
h5/utils/service.js | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/h5/utils/service.js b/h5/utils/service.js
index 41d0bdf..55d60a4 100644
--- a/h5/utils/service.js
+++ b/h5/utils/service.js
@@ -1,4 +1,4 @@
-import { baseUrl } from "./config.js"
+import { baseUrl, app_url } from "./config.js"
export const http = function (options) {
{
return new Promise((resolve, reject) => {
@@ -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) => {
@@ -33,12 +33,17 @@
icon: "none",
duration: 2000
})
- })
- }
- if (data.code === 5112) {
- uni.navigateTo({
- url: '/pages/login/login'
- })
+ },500)
+ if (data.code === 500) {
+ uni.showToast({
+ 'title': '鏈嶅姟鍣ㄥ紓甯�',icon:'none'
+ })
+ }
+ if (data.code === 5112) {
+ uni.clearStorageSync()
+ window.location.href = app_url
+ }
+ return resolve(data)
}
resolve(data)
// return response.data
@@ -46,7 +51,8 @@
fail: (err) => {
// 椤甸潰涓脊妗嗘樉绀哄け璐�
uni.showToast({
- title: '璇锋眰鎺ュ彛澶辫触'
+ title: '璇锋眰鎺ュ彛澶辫触',
+ icon:"none"
})
// 杩斿洖閿欒娑堟伅
--
Gitblit v1.9.3