|
@@ -23,7 +23,7 @@ import {
|
|
|
|
|
|
const error = throttle((msg: string) => ElMessage.error(msg), 2000);
|
|
|
|
|
|
-type Other = { params?: Param; paths?: Param; useResult?: boolean };
|
|
|
+type Other = { params?: Param; paths?: Param; useResult?: boolean, noToken?: boolean };
|
|
|
export const sendFetch = <T>(
|
|
|
url: string,
|
|
|
init: RequestInit,
|
|
@@ -41,6 +41,9 @@ export const sendFetch = <T>(
|
|
|
sendUrl =
|
|
|
sendUrl + "?" + new URLSearchParams({ ...gParams, ...other.params });
|
|
|
}
|
|
|
+ if (other.noToken) {
|
|
|
+ delete gHeaders.token
|
|
|
+ }
|
|
|
}
|
|
|
lifeHook.forEach(({ start }) => start());
|
|
|
|
|
@@ -48,9 +51,9 @@ export const sendFetch = <T>(
|
|
|
...init,
|
|
|
headers: headers
|
|
|
? {
|
|
|
- ...headers,
|
|
|
- ...gHeaders,
|
|
|
- }
|
|
|
+ ...headers,
|
|
|
+ ...gHeaders,
|
|
|
+ }
|
|
|
: gHeaders,
|
|
|
})
|
|
|
.then((res) => {
|