Browse Source

[完善]退出系统完善

dev
邵佳豪 3 years ago
parent
commit
0a87ea10f4
  1. 3
      src/app/http-interceptors/base-interceptor.ts

3
src/app/http-interceptors/base-interceptor.ts

@ -56,7 +56,8 @@ export class BaseInterceptor implements HttpInterceptor {
if (error.status === 401 || error.status === 614) { if (error.status === 401 || error.status === 614) {
this.token.delete() this.token.delete()
sessionStorage.clear() sessionStorage.clear()
window.localStorage.clear() // window.localStorage.clear()
localStorage.removeItem("isautologin")
this.cookieService.set("token", '', new Date(new Date().getTime() + 1), '/') this.cookieService.set("token", '', new Date(new Date().getTime() + 1), '/')
this.cookieService.set("refreshToken", '', new Date(new Date().getTime() + 1), '/') this.cookieService.set("refreshToken", '', new Date(new Date().getTime() + 1), '/')
this.message.create('error', `用户认证信息过期,请重新登录!`); this.message.create('error', `用户认证信息过期,请重新登录!`);

Loading…
Cancel
Save