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(()=>{ await store.dispatch('user/getUserInfo',_username).then(()=>{
console.log("-------用户信息获取成功-------") console.log("-------用户信息获取成功-------")
localStorage.setItem('alreadyTryLogin',true) localStorage.setItem('alreadyTryLogin',true)
next({ next(to)
...to, // next({
query:{ // ...to,
loginName:to.query.loginName, // query:{
isAutoLogin:to.query.isAutoLogin, // loginName:to.query.loginName,
isSinglePage:to.query.isSinglePage // isAutoLogin:to.query.isAutoLogin,
}, // isSinglePage:to.query.isSinglePage
replace: true // },
}) // replace: true
// })
}).catch(()=>{ }).catch(()=>{
localStorage.setItem('alreadyTryLogin',true) localStorage.setItem('alreadyTryLogin',true)
next() 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(()=>{ await store.dispatch('user/getUserInfo',_username).then(()=>{
console.log("-------用户信息获取成功-------") console.log("-------用户信息获取成功-------")
localStorage.setItem('alreadyTryLogin',true) localStorage.setItem('alreadyTryLogin',true)
next({ next(to)
...to, // next({
query:{ // ...to,
loginName:to.query.loginName, // query:{
isAutoLogin:to.query.isAutoLogin, // loginName:to.query.loginName,
isSinglePage:to.query.isSinglePage // isAutoLogin:to.query.isAutoLogin,
}, // isSinglePage:to.query.isSinglePage
replace: true // },
}) // replace: true
// })
}).catch(()=>{ }).catch(()=>{
localStorage.setItem('alreadyTryLogin',true) localStorage.setItem('alreadyTryLogin',true)
next() 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(()=>{ await store.dispatch('user/getUserInfo',_username).then(()=>{
console.log("-------用户信息获取成功-------") console.log("-------用户信息获取成功-------")
localStorage.setItem('alreadyTryLogin',true) localStorage.setItem('alreadyTryLogin',true)
next({ next(to)
...to, // next({
query:{ // ...to,
loginName:to.query.loginName, // query:{
isAutoLogin:to.query.isAutoLogin, // loginName:to.query.loginName,
isSinglePage:to.query.isSinglePage // isAutoLogin:to.query.isAutoLogin,
}, // isSinglePage:to.query.isSinglePage
replace: true // },
}) // replace: true
// })
}).catch(()=>{ }).catch(()=>{
localStorage.setItem('alreadyTryLogin',true) localStorage.setItem('alreadyTryLogin',true)
next() next()

Loading…
Cancel
Save