From cbc99e27f63ad2da0369187a8b6f58ad37dd2be3 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期三, 28 一月 2026 08:09:32 +0800
Subject: [PATCH] #
---
common/request.js | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/common/request.js b/common/request.js
index 53b11d5..11c481a 100644
--- a/common/request.js
+++ b/common/request.js
@@ -16,7 +16,7 @@
const token = uni.getStorageSync('token');
// const URL = 'http://47.76.147.249:8080/rsf-server/pda' + url;
// const URL = 'http://test.zoneyung.net:8080/rsf-server/pda' + url;
- const URL = 'http://127.0.0.1:8080/rsf-server/pda' + url;
+ const URL = 'http://127.0.0.1:8085/rsf-server/pda' + url;
uni.request({
url: URL,
data: postData,
@@ -26,14 +26,21 @@
},
method: method, //'GET','POST'
dataType: 'json',
+ timeout: 30000, // 30绉掕秴鏃�
success: (res) => {
!hideLoading && uni.hideLoading()
resolve(res.data)
},
fail: (res) => {
- // !hideLoading && toast("缃戠粶涓嶇粰鍔涳紝璇风◢鍚庡啀璇晘")
- //wx.hideLoading()
+ !hideLoading && uni.hideLoading()
+ // 鍒ゆ柇鏄惁涓鸿秴鏃堕敊璇�
+ const isTimeout = res.errMsg && (res.errMsg.includes('timeout') || res.errMsg.includes('瓒呮椂'))
+ uni.showToast({
+ title: isTimeout ? '缃戠粶璇锋眰瓒呮椂锛岃妫�鏌ョ綉缁滆繛鎺�' : '缃戠粶璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯',
+ icon: 'none',
+ duration: 3000
+ })
reject(res)
}
})
--
Gitblit v1.9.1