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 }