diff --git a/README.md b/README.md index 41fa697..249b388 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -智能实战指挥平台-前端项目 - - ---广西 演示 +指挥员指挥能力考评抽签-前端项目 项目初始化:npm install diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 13a5c02..f3f4ecf 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -16,20 +16,6 @@ export class AppComponent { constructor(private http:HttpClient,private router:Router,public token:CacheTokenService) { } ngOnInit(): void { - var token = sessionStorage.getItem("token"); - var refreshToken = sessionStorage.getItem("refreshToken"); - if(token && refreshToken) { - this.http.post('/api/Account/RefreshToken', { - token: token, - refreshToken: refreshToken - }).subscribe((data: Data) => { - sessionStorage.setItem("level",data.level); - sessionStorage.setItem("token",data.token); - sessionStorage.setItem("refreshToken",data.refreshToken); - this.token.startUp() - }) - } - } diff --git a/src/app/http-interceptors/base-interceptor.ts b/src/app/http-interceptors/base-interceptor.ts index 76b39b8..066dec9 100644 --- a/src/app/http-interceptors/base-interceptor.ts +++ b/src/app/http-interceptors/base-interceptor.ts @@ -44,26 +44,13 @@ export class BaseInterceptor implements HttpInterceptor { private handleError(error: HttpErrorResponse) { // 用户认证失败返回登录页 if (error.status === 401||error.status === 614) { - this.token.delete() - sessionStorage.clear() - window.localStorage.clear() - this.router.navigate(['ui/plan']) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('用户认证信息过期,请重新登录','确定',config); + } if (error.status === 403) { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('对不起,您无此权限','确定',config); + } if (error.status === 400) { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('请核对您的输入格式是否正确','确定',config); + } if (error.error instanceof ErrorEvent) {