Browse Source

路由优化

noToken
安虹睿 1 year ago
parent
commit
548757321c
  1. 19
      PC/InterFace.Dash/src/permission.js
  2. 19
      PC/UI.WinIn.FasterZ.Job/src/permission.js
  3. 19
      PC/UI.WinIn.FasterZ.Store/src/permission.js

19
PC/InterFace.Dash/src/permission.js

@ -73,15 +73,16 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('user/getUserInfo',_username).then(()=>{
console.log("-------用户信息获取成功-------")
localStorage.setItem('alreadyTryLogin',true)
next({
...to,
query:{
loginName:to.query.loginName,
isAutoLogin:to.query.isAutoLogin,
isSinglePage:to.query.isSinglePage
},
replace: true
})
next(to)
// next({
// ...to,
// query:{
// loginName:to.query.loginName,
// isAutoLogin:to.query.isAutoLogin,
// isSinglePage:to.query.isSinglePage
// },
// replace: true
// })
}).catch(()=>{
localStorage.setItem('alreadyTryLogin',true)
next()

19
PC/UI.WinIn.FasterZ.Job/src/permission.js

@ -73,15 +73,16 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('user/getUserInfo',_username).then(()=>{
console.log("-------用户信息获取成功-------")
localStorage.setItem('alreadyTryLogin',true)
next({
...to,
query:{
loginName:to.query.loginName,
isAutoLogin:to.query.isAutoLogin,
isSinglePage:to.query.isSinglePage
},
replace: true
})
next(to)
// next({
// ...to,
// query:{
// loginName:to.query.loginName,
// isAutoLogin:to.query.isAutoLogin,
// isSinglePage:to.query.isSinglePage
// },
// replace: true
// })
}).catch(()=>{
localStorage.setItem('alreadyTryLogin',true)
next()

19
PC/UI.WinIn.FasterZ.Store/src/permission.js

@ -73,15 +73,16 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('user/getUserInfo',_username).then(()=>{
console.log("-------用户信息获取成功-------")
localStorage.setItem('alreadyTryLogin',true)
next({
...to,
query:{
loginName:to.query.loginName,
isAutoLogin:to.query.isAutoLogin,
isSinglePage:to.query.isSinglePage
},
replace: true
})
next(to)
// next({
// ...to,
// query:{
// loginName:to.query.loginName,
// isAutoLogin:to.query.isAutoLogin,
// isSinglePage:to.query.isSinglePage
// },
// replace: true
// })
}).catch(()=>{
localStorage.setItem('alreadyTryLogin',true)
next()

Loading…
Cancel
Save