update 优化token失效后跳转登录页的逻辑
This commit is contained in:
+15
-2
@@ -7,9 +7,22 @@ export enum PageEnum {
|
||||
}
|
||||
|
||||
export function setBaseLogin(baseLogin) {
|
||||
sessionStorage.setItem('baseLogin', baseLogin);
|
||||
localStorage.setItem('baseLogin', baseLogin);
|
||||
}
|
||||
|
||||
export function getBaseLogin() {
|
||||
return sessionStorage.getItem('baseLogin');
|
||||
return localStorage.getItem('baseLogin');
|
||||
}
|
||||
|
||||
//根据当前路径跳转登录页
|
||||
export function toLoginByNowPath(nowPath: string) {
|
||||
//西安的页面路径
|
||||
const xianPath = ['/home', '/secondScreen'];
|
||||
//银川的页面路径
|
||||
const yinchuanPath = ['/yinChuanHome'];
|
||||
if (xianPath.includes(nowPath)) {
|
||||
return PageEnum.BASE_LOGIN;
|
||||
} else if (yinchuanPath.includes(nowPath)) {
|
||||
return PageEnum.BASE_LOGIN_YINCHUAN;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user