fix: 字典重新登录unknown的情况
This commit is contained in:
parent
44ad2c5f8d
commit
bc2beefa7e
@ -225,7 +225,7 @@ function createRequestClient(baseURL: string) {
|
|||||||
case 401: {
|
case 401: {
|
||||||
// 已经在登出过程中 不再执行
|
// 已经在登出过程中 不再执行
|
||||||
if (isLogoutProcessing) {
|
if (isLogoutProcessing) {
|
||||||
return;
|
throw new Error(timeoutMsg);
|
||||||
}
|
}
|
||||||
isLogoutProcessing = true;
|
isLogoutProcessing = true;
|
||||||
const _msg = $t('http.loginTimeout');
|
const _msg = $t('http.loginTimeout');
|
||||||
@ -235,7 +235,7 @@ function createRequestClient(baseURL: string) {
|
|||||||
isLogoutProcessing = false;
|
isLogoutProcessing = false;
|
||||||
});
|
});
|
||||||
// 不再执行下面逻辑
|
// 不再执行下面逻辑
|
||||||
return;
|
throw new Error(_msg);
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
if (msg) {
|
if (msg) {
|
||||||
|
@ -27,6 +27,10 @@ function fetchAndCacheDictData<T>(
|
|||||||
// 内部处理了push的逻辑 这里不用push
|
// 内部处理了push的逻辑 这里不用push
|
||||||
setDictInfo(dictName, resp, formatNumber);
|
setDictInfo(dictName, resp, formatNumber);
|
||||||
})
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// 401时 移除字典缓存 下次登录重新获取
|
||||||
|
dictRequestCache.delete(dictName);
|
||||||
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
// 移除请求状态缓存
|
// 移除请求状态缓存
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user