一些异常 不应该影响用户登录

This commit is contained in:
wkj 2024-12-04 09:51:05 +08:00
parent e2307713a3
commit 2092a54f46
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, OakRequestTimeoutException, } from 'oak-domain/lib/types/Exception';
import { OakUnloggedInException, OakNetworkException, OakServerProxyException, OakPreConditionUnsetException, OakRequestTimeoutException, OakClockDriftException, } from 'oak-domain/lib/types/Exception';
import { tokenProjection } from '../types/Projection';
import { OakUserInfoLoadingException } from '../types/Exception';
import { LOCAL_STORAGE_KEYS } from '../config/constants';
@ -62,7 +62,8 @@ export class Token extends Feature {
console.warn(err);
if (err instanceof OakNetworkException ||
err instanceof OakServerProxyException ||
err instanceof OakRequestTimeoutException) {
err instanceof OakRequestTimeoutException ||
err instanceof OakClockDriftException) {
return;
}
this.removeToken(true);

View File

@ -65,7 +65,8 @@ class Token extends Feature_1.Feature {
console.warn(err);
if (err instanceof Exception_1.OakNetworkException ||
err instanceof Exception_1.OakServerProxyException ||
err instanceof Exception_1.OakRequestTimeoutException) {
err instanceof Exception_1.OakRequestTimeoutException ||
err instanceof Exception_1.OakClockDriftException) {
return;
}
this.removeToken(true);

View File

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