perf(X-Pack): 优化 Token 刷新机制,避免非必要开销

This commit is contained in:
fit2cloud-chenyw
2025-04-07 16:04:14 +08:00
committed by fit2cloud-chenyw
parent 471c54821d
commit b822b8a41f

View File

@@ -55,7 +55,7 @@ export const configHandler = config => {
if (wsCache.get('user.token')) {
config.headers['X-DE-TOKEN'] = wsCache.get('user.token')
const expired = isExpired()
if (expired && config.url !== refreshUrl) {
if (expired && !config.url.includes(refreshUrl)) {
if (!getRefreshStatus()) {
setRefreshStatus(true)
refreshApi(Date.now())