feat: There is no way the, welink 福田业务系统首页 路由 访问问题

This commit is contained in:
396572590@qq.com
2022-06-22 10:34:48 +08:00
parent 59632fcba8
commit ee1b234b26
2 changed files with 23 additions and 2 deletions
+21 -1
View File
@@ -145,7 +145,16 @@ router.beforeEach(function (to, from, next) {
/** 判断是不是在手机端操作 */
if (isMobile()) {
if(toName === 'phoneHome' && (token === undefined || token === null || token === '')){
localStorage.removeItem('token')
token = localStorage.getItem("token")
window.sessionStorage.clear()
localStorage.setItem("routerName","phoneHome")
next('/loginVerifyPhone')
}else if(toName === 'phoneHome' && token != null && (fromName === undefined || fromName === null)){
localStorage.removeItem('token')
token = localStorage.getItem("token")
window.sessionStorage.clear()
next()
}else if(toName === 'phoneHome' && token != null){
next()
} else if(toName === 'processCenter'){
@@ -169,7 +178,14 @@ router.beforeEach(function (to, from, next) {
if(toName !== 'phoneIndex'){
if(toName === 'phoneHome'){
// 手机端 首页 首次进入系统 清除 缓存, 防止 跳转 oa 的页面, 问题追溯 #55852
localStorage.removeItem('token')
token = localStorage.getItem("token")
window.sessionStorage.clear()
localStorage.setItem("routerName","phoneHome")
next('/loginVerifyPhone')
}else if(toName === 'databaseSearch' || toName === 'standDynamics' ||
toName === 'domesticStand' || toName === 'domesticDetails'){
localStorage.setItem("routerName",toName)
next('/loginVerifyPhone')
}else {
if(fromName === 'phoneHome'){
@@ -184,13 +200,17 @@ router.beforeEach(function (to, from, next) {
// 区分手机端首页 单独逻辑处理 token 为空 跳回验证页面重新验证
if(fromName === 'databaseSearch' || fromName === 'standDynamics' ||
fromName === 'domesticStand' || fromName === 'domesticDetails'){
localStorage.setItem("routerName",toName)
next('/loginVerifyPhone')
}else {
next()
}
}
} else {
if (toName.slice(0,5) !== 'phone') {
if(toName === 'databaseSearch' || toName === 'standDynamics' ||
toName === 'domesticStand' || toName === 'domesticDetails'){
next()
}else if (toName.slice(0,5) !== 'phone') {
if(toName === 'LoginVerify'){
next('/blankPage')
}else {
+2 -1
View File
@@ -89,7 +89,8 @@
window.sessionStorage.setItem('menuList', menuList); // del
if (hasHomeMenu) {
this.setMenu(JSON.stringify(menuList)).then(res => {
this.$router.push("/phoneHome")
let routerName = localStorage.getItem("routerName")
this.$router.push('/'+routerName)
}, e => {
console.log("解析遍历权限列表出现异常")
this.logout()