release: update 5.1.0

This commit is contained in:
xiaoxian521
2024-03-09 16:27:52 +08:00
parent ff27074ebd
commit 1121c5a2b5
148 changed files with 8005 additions and 8352 deletions

View File

@@ -1,9 +1,9 @@
import Axios, {
AxiosInstance,
AxiosRequestConfig,
CustomParamsSerializer
type AxiosInstance,
type AxiosRequestConfig,
type CustomParamsSerializer
} from "axios";
import {
import type {
PureHttpError,
RequestMethods,
PureHttpResponse,
@@ -73,8 +73,8 @@ class PureHttp {
return config;
}
/** 请求白名单放置一些不需要token的接口通过设置请求白名单防止token过期后再请求造成的死循环问题 */
const whiteList = ["/refreshToken", "/login"];
return whiteList.some(v => config.url.indexOf(v) > -1)
const whiteList = ["/refresh-token", "/login"];
return whiteList.find(url => url === config.url)
? config
: new Promise(resolve => {
const data = getToken();