|
|
@@ -14,7 +14,7 @@ function debounce(option) {
|
|
|
}
|
|
|
export function fetch(option) {
|
|
|
let { url, method, headers, body, timeout, allow, requestType, fileName } = option;
|
|
|
- const token = window.sessionStorage.getItem("token");
|
|
|
+ const token = token === false ? null : window.sessionStorage.getItem("token");
|
|
|
return debounce({ url, method, body }).then(() => {
|
|
|
// 除非特殊许可,Token不存在时不发送请求
|
|
|
if(token || allow) {
|
|
|
@@ -26,6 +26,7 @@ export function fetch(option) {
|
|
|
token: token,
|
|
|
'Content-Type': 'application/json'
|
|
|
}, headers);
|
|
|
+
|
|
|
if (body) {
|
|
|
let paramsArray = [];
|
|
|
//拼接参数
|