From a88092021b14abc67c2f2e53ce722d609632aeb5 Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期二, 23 八月 2022 08:07:36 +0800
Subject: [PATCH] 修改日计划,我的待办,等相应bug
---
utils/request.js | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/utils/request.js b/utils/request.js
index b8a09ec..451dd24 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -23,16 +23,11 @@
duration: 2000
});
setTimeout(() => {
- try {
uni.clearStorageSync();
// 閲嶅畾鍚戠櫥褰�
uni.redirectTo({
url: '/pages/login/login'
})
- } catch (e) {
- // error
- console.log(e)
- }
}, 2000);
return false;
}
@@ -73,7 +68,7 @@
title: response.data.msg,
icon: 'error',
position: 'top',
- duration: 1000
+ duration: 2000
})
return false;
}
@@ -87,23 +82,28 @@
500: responseError
}
+// let BaseUrl = 'http://192.168.0.159:9999';
+// const BaseUrl = 'https://mx.jzeg.cn:443/app';
+const BaseUrl = "https://mx.jzeg.cn:9998";
// 璇锋眰鎷︽埅
const fetch = (url, opt ,urlParam) => {
+
let urls = (api[opt.url]?.url || api[url]?.url || jihua[opt.url]?.url || jihua[url]?.url);
let params = opt.params ? ('?' + Object.keys(opt.params).map(key => key + '=' + opt.params[key]).join('&')) :
'';
- opt.url = urlParam ? urls + `/${urlParam}` + params : urls + params
+ opt.url = urlParam ? BaseUrl + urls + `/${urlParam}` + params : BaseUrl + urls + params
opt.method = opt.method || "GET";
var header = {}
if (uni.getStorageSync('access_token')) {
header = {
"TENANT-ID": 5,
Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
- VERSION: "zzl"
+ VERSION: "zzl",
+ Accept:'application/json, text/plain, */*' // 瀹㈡埛绔墍鑳芥帴鍙楃殑鏁版嵁绫诲瀷
}
}
-
+
opt.header = {
...opt.header,
...header
@@ -135,7 +135,6 @@
statusCode,
data
} = resp;
-
// 楠岃瘉http鐘舵�佺爜
const handlerHTTPStatus = handlerCode[statusCode];
@@ -153,5 +152,6 @@
export {
- fetch
+ fetch,
+ BaseUrl
}
--
Gitblit v1.9.1