|
@ -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) => { |
|
|
const toNextHandle = async (to, from, next) => { |
|
|
let isFresh = false |
|
|
let isFresh = false |
|
@ -67,8 +77,7 @@ const toNextHandle = async (to, from, next) => { |
|
|
// 获取表头转义
|
|
|
// 获取表头转义
|
|
|
if(!store.getters.columZHList){ |
|
|
if(!store.getters.columZHList){ |
|
|
await store.dispatch('definition/getColumZHList').catch(()=>{ |
|
|
await store.dispatch('definition/getColumZHList').catch(()=>{ |
|
|
Message.error(getErrMsg) |
|
|
getErrHandle(to, from, next) |
|
|
NProgress.done() |
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -84,16 +93,14 @@ const toNextHandle = async (to, from, next) => { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(()=>{ |
|
|
.catch(()=>{ |
|
|
Message.error(getErrMsg) |
|
|
getErrHandle(to, from, next) |
|
|
NProgress.done() |
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 获取枚举数据
|
|
|
// 获取枚举数据
|
|
|
if(!store.getters.enumList || store.getters.enumList.length <= 0){ |
|
|
if(!store.getters.enumList || store.getters.enumList.length <= 0){ |
|
|
await store.dispatch('definition/getDefinitionConfig').catch(()=>{ |
|
|
await store.dispatch('definition/getDefinitionConfig').catch(()=>{ |
|
|
Message.error(getErrMsg) |
|
|
getErrHandle(to, from, next) |
|
|
NProgress.done() |
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|