diff --git a/PC/InterFace.Dash/src/permission.js b/PC/InterFace.Dash/src/permission.js index 6b26604..cd0d850 100644 --- a/PC/InterFace.Dash/src/permission.js +++ b/PC/InterFace.Dash/src/permission.js @@ -60,6 +60,16 @@ const toPageInit = async (to, from, next) => { } +// 获取数据失败处理 +const getErrHandle = (to, from, next) => { + let isAutoLogin = JSON.parse(localStorage.getItem('isConfigLogin')) || to.query.loginName + Message.error(getErrMsg) + if(!isAutoLogin){ + store.dispatch("user/logout") + } + NProgress.done() +} + // 跳转处理 const toNextHandle = async (to, from, next) => { let isFresh = false @@ -67,8 +77,7 @@ const toNextHandle = async (to, from, next) => { // 获取表头转义 if(!store.getters.columZHList){ await store.dispatch('definition/getColumZHList').catch(()=>{ - Message.error(getErrMsg) - NProgress.done() + getErrHandle(to, from, next) }) } @@ -84,16 +93,14 @@ const toNextHandle = async (to, from, next) => { } }) .catch(()=>{ - Message.error(getErrMsg) - NProgress.done() + getErrHandle(to, from, next) }) } // 获取枚举数据 if(!store.getters.enumList || store.getters.enumList.length <= 0){ await store.dispatch('definition/getDefinitionConfig').catch(()=>{ - Message.error(getErrMsg) - NProgress.done() + getErrHandle(to, from, next) }) }