diff --git a/src/api/model/hfnf.js b/src/api/model/hfnf.js index 2343af9e..27f45a11 100644 --- a/src/api/model/hfnf.js +++ b/src/api/model/hfnf.js @@ -26,4 +26,4 @@ export default { } }, } -} \ No newline at end of file +} diff --git a/src/router/index.js b/src/router/index.js index 72dea5be..0bd5783a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -66,8 +66,13 @@ router.beforeEach(async (to, from, next) => { } //加载动态/静态路由 if (!isGetRouter) { + let baseInfo = tool.data.get('BASE_INFO'); + if (!baseInfo) { + next({ path: '/login' }); + return false; + } let userMenu = []; - if(tool.data.get('BASE_INFO').base.base_menucate=='dynamic'){ + if(baseInfo.base.base_menucate=='dynamic'){ userMenu = tool.data.get("MENU") || []; }else{ let permissions = tool.data.get("PERMISSIONS") || [];//账号页面权限 @@ -114,7 +119,9 @@ router.onError((error) => { //入侵追加自定义方法、对象 router.sc_getMenu = () => { - if(tool.data.get('BASE_INFO').base.base_menucate=='dynamic'){ + let baseInfo = tool.data.get('BASE_INFO'); + if(!baseInfo) return []; + if(baseInfo.base.base_menucate=='dynamic'){ return tool.data.get("MENU") || [] } else{ diff --git a/src/views/fac_cal/hfnf_index.vue b/src/views/fac_cal/hfnf_index.vue index 2e051bce..dc1c9f11 100644 --- a/src/views/fac_cal/hfnf_index.vue +++ b/src/views/fac_cal/hfnf_index.vue @@ -1,5 +1,5 @@