mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-06 00:18:51 +08:00
perf: 优化请求白名单的判断逻辑
This commit is contained in:
parent
d27c0623c5
commit
49106b90b7
@ -74,7 +74,7 @@ class PureHttp {
|
||||
}
|
||||
/** 请求白名单,放置一些不需要token的接口(通过设置请求白名单,防止token过期后再请求造成的死循环问题) */
|
||||
const whiteList = ["/refreshToken", "/login"];
|
||||
return whiteList.some(v => config.url.indexOf(v) > -1)
|
||||
return whiteList.find(url => url === config.url)
|
||||
? config
|
||||
: new Promise(resolve => {
|
||||
const data = getToken();
|
||||
|
Loading…
x
Reference in New Issue
Block a user