Commit cdacc0ca by 李伟康

fix(auth): 修复登录过期处理和路由权限检查问题

- 移除登录过期时的临时导航处理注释
- 激活微信工作台环境下的路由权限检查逻辑
- 添加用户订阅配置响应数据的安全检查,避免空指针异常
1 parent 0cbf369e
...@@ -50,7 +50,7 @@ fetchConfig(!isMock).then(res => { ...@@ -50,7 +50,7 @@ fetchConfig(!isMock).then(res => {
window.reLogin = () => { window.reLogin = () => {
util.removeLocalStorage('ww_userInfo') util.removeLocalStorage('ww_userInfo')
util.clearSessionId() util.clearSessionId()
store.dispatch('navigation') // 暂时不管登录过期 store.dispatch('navigation')
} }
window.vm = new Vue({ window.vm = new Vue({
el: '#app', el: '#app',
......
...@@ -41,7 +41,7 @@ router.beforeEach((to, from, next) => { ...@@ -41,7 +41,7 @@ router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面背景色 */ /* 路由发生变化修改页面背景色 */
document.documentElement.style.backgroundColor = to.meta.backgroundColor || '#fff' document.documentElement.style.backgroundColor = to.meta.backgroundColor || '#fff'
if (to.matched.some(recode => recode.meta.noAuth)) { if (to.matched.some(recode => recode.meta.noAuth)) {
// if (!isWxWork && to.name !== 'notWxWork') return next('/mobile/notWxWork') //上线打开 if (!isWxWork && to.name !== 'notWxWork') return next('/mobile/notWxWork') //上线打开
store.state.app.showWindow = true store.state.app.showWindow = true
store.dispatch('registerHttp') store.dispatch('registerHttp')
} else { } else {
......
...@@ -44,8 +44,10 @@ export default { ...@@ -44,8 +44,10 @@ export default {
}, },
mounted () { mounted () {
reportApi.getUserSubscribeConfig().then(res => { reportApi.getUserSubscribeConfig().then(res => {
if(res){
this.weeklyReport = res.weeklyReportSubscribe == 1 || false this.weeklyReport = res.weeklyReportSubscribe == 1 || false
this.monthlyReport = res.monthlyReportSubscribe == 1 || false this.monthlyReport = res.monthlyReportSubscribe == 1 || false
}
}) })
}, },
methods: { methods: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!