From 6bbfcc1e58092d7cb1958047268082873b964e0f Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 16 Dec 2020 09:07:32 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E9=80=80=E5=87=BA?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=B8=85=E7=A9=BA=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/http-interceptors/base-interceptor.ts | 1 + src/app/tabbar/tabbar.component.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/http-interceptors/base-interceptor.ts b/src/app/http-interceptors/base-interceptor.ts index 4f22d6a..4cabcd7 100644 --- a/src/app/http-interceptors/base-interceptor.ts +++ b/src/app/http-interceptors/base-interceptor.ts @@ -46,6 +46,7 @@ export class BaseInterceptor implements HttpInterceptor { // 用户认证失败返回登录页 if (error.status === 401||error.status === 614) { sessionStorage.clear() + localStorage.clear() this.router.navigate(['/login']) const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; diff --git a/src/app/tabbar/tabbar.component.ts b/src/app/tabbar/tabbar.component.ts index c90b195..4f187d3 100644 --- a/src/app/tabbar/tabbar.component.ts +++ b/src/app/tabbar/tabbar.component.ts @@ -40,6 +40,7 @@ export class TabbarComponent implements OnInit { if(out) { this.http.post('/api/ExamAccounts/SignOut',{}).subscribe(data=>{ sessionStorage.clear() + localStorage.clear() this.token.delete() this.router.navigate(['/login']) const config = new MatSnackBarConfig(); @@ -47,7 +48,6 @@ export class TabbarComponent implements OnInit { config.duration = 3000 this.snackBar.open('退出成功','确定',config); }) - localStorage.removeItem("checkedWork") } //if }