Commit d59fed1c by 李伟康

fix(router): 修复移动端路由微信工作台验证逻辑

- 移除 reportCard 页面的 noWxWork 限制配置
- 修复路由守卫中的代码格式问题
- 调整非微信工作台环境下的路由跳转逻辑
- 确保在非微信工作台环境下正确跳转到 notWxWork 页面
- 修复路由守卫中的条件判断顺序问题
1 parent cdacc0ca
......@@ -10,7 +10,6 @@ export const mobilePages = {
name: 'reportCard',
meta: {
noAuth: true,
noWxWork: true
}
},
{
......
......@@ -37,15 +37,16 @@ router.beforeEach((to, from, next) => {
store.commit('SET_LAST_PATH', to.name)
/* 路由发生变化修改页面title */
store.dispatch('setPageMeta', to.meta)
console.log(!isWxWork , to.name)
console.log(!isWxWork, to.name)
/* 路由发生变化修改页面背景色 */
document.documentElement.style.backgroundColor = to.meta.backgroundColor || '#fff'
if (to.matched.some(recode => recode.meta.noAuth)) {
if (!isWxWork && to.name !== 'notWxWork') return next('/mobile/notWxWork') //上线打开
store.state.app.showWindow = true
store.dispatch('registerHttp')
} else {
store.dispatch('navigation', to) // 暂时不管登录过期
if (!isWxWork && to.name !== 'notWxWork') return next('/mobile/notWxWork') //上线打开
store.dispatch('navigation', to)
}
next()
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!