|
|
@@ -22,22 +22,22 @@ export async function createPermissionGuard(router: Router) {
|
|
|
var token = session.getItem('tokenSpace')
|
|
|
var tokenV2 = session.getItem('tokenV2')
|
|
|
if ((location.href.indexOf('refreshToken') > -1) && (!token || !tokenV2)) {
|
|
|
- var o = session.getItem('loginParams');
|
|
|
- if (o && o.username) {
|
|
|
- await userStore2.login({
|
|
|
- password: 'Tofly@028',
|
|
|
- username: o.username.toUpperCase(),
|
|
|
- mode: 'modal'
|
|
|
- })//地灾使用这个
|
|
|
- //修改地址栏链接
|
|
|
- window.history.pushState('', '', location.href.split('?')[0]);
|
|
|
- window.location.reload();
|
|
|
- return;
|
|
|
- } else {
|
|
|
- sessionStorage.clear();
|
|
|
- localStorage.clear();
|
|
|
- window.location.href = '/admin/index.html';
|
|
|
- }
|
|
|
+ // var o = session.getItem('loginParams');
|
|
|
+ // if (o && o.username) {
|
|
|
+ // await userStore2.login({
|
|
|
+ // password: 'Tofly@028',
|
|
|
+ // username: o.username.toUpperCase(),
|
|
|
+ // mode: 'modal'
|
|
|
+ // })//地灾使用这个
|
|
|
+ // //修改地址栏链接
|
|
|
+ // window.history.pushState('', '', location.href.split('?')[0]);
|
|
|
+ // window.location.reload();
|
|
|
+ // return;
|
|
|
+ // } else {
|
|
|
+ // sessionStorage.clear();
|
|
|
+ // localStorage.clear();
|
|
|
+ // window.location.href = '/admin/index.html';
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
@@ -66,10 +66,10 @@ export async function createPermissionGuard(router: Router) {
|
|
|
}
|
|
|
} catch { }
|
|
|
} else if (to.path == LOGIN_PATH && !(location.href.indexOf('127.0.0.1') > -1) && !(location.href.indexOf('localhost') > -1)) {
|
|
|
- sessionStorage.clear();//地灾项目使用这个
|
|
|
- localStorage.clear();//地灾项目使用这个
|
|
|
- window.location.href = '/admin/index.html';//地灾项目使用这个
|
|
|
- return;
|
|
|
+ // sessionStorage.clear();//地灾项目使用这个
|
|
|
+ // localStorage.clear();//地灾项目使用这个
|
|
|
+ // window.location.href = '/admin/index.html';//地灾项目使用这个
|
|
|
+ // return;
|
|
|
}
|
|
|
next();
|
|
|
return;
|