超时异常 不需要移除Toekn的

This commit is contained in:
wkj 2024-12-03 16:33:08 +08:00
parent 4ab65051f4
commit e2307713a3
3 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import { Feature } from 'oak-frontend-base/es/types/Feature';
import { OakUnloggedInException, OakNetworkException, OakServerProxyException, OakPreConditionUnsetException, } from 'oak-domain/lib/types/Exception';
import { OakUnloggedInException, OakNetworkException, OakServerProxyException, OakPreConditionUnsetException, OakRequestTimeoutException, } from 'oak-domain/lib/types/Exception';
import { tokenProjection } from '../types/Projection';
import { OakUserInfoLoadingException } from '../types/Exception';
import { LOCAL_STORAGE_KEYS } from '../config/constants';
@ -61,7 +61,8 @@ export class Token extends Feature {
// refresh出了任何错都无视(排除网络异常)直接放弃此token
console.warn(err);
if (err instanceof OakNetworkException ||
err instanceof OakServerProxyException) {
err instanceof OakServerProxyException ||
err instanceof OakRequestTimeoutException) {
return;
}
this.removeToken(true);

View File

@ -64,7 +64,8 @@ class Token extends Feature_1.Feature {
// refresh出了任何错都无视(排除网络异常)直接放弃此token
console.warn(err);
if (err instanceof Exception_1.OakNetworkException ||
err instanceof Exception_1.OakServerProxyException) {
err instanceof Exception_1.OakServerProxyException ||
err instanceof Exception_1.OakRequestTimeoutException) {
return;
}
this.removeToken(true);

View File

@ -6,6 +6,7 @@ import {
OakNetworkException,
OakServerProxyException,
OakPreConditionUnsetException,
OakRequestTimeoutException,
} from 'oak-domain/lib/types/Exception';
import { Cache } from 'oak-frontend-base/es/features/cache';
import { LocalStorage } from 'oak-frontend-base/es/features/localStorage';
@ -88,7 +89,8 @@ export class Token<ED extends EntityDict> extends Feature {
console.warn(err);
if (
err instanceof OakNetworkException ||
err instanceof OakServerProxyException
err instanceof OakServerProxyException ||
err instanceof OakRequestTimeoutException
) {
return;
}