|
@@ -50,23 +50,23 @@ router.beforeEach(async (to, from, next) => {
|
|
|
try {
|
|
|
const treeData = await store.dispatch('user/getMenuInfo')
|
|
|
if (Array.isArray(treeData) && treeData.length) {
|
|
|
- const nd = treeData.filter(item => item.pageconfigurationid)
|
|
|
const ndOrder = _.orderBy(treeData,['displaynumber'])
|
|
|
- store.dispatch('auth/changeAuthArrs', ndOrder)
|
|
|
+ const nd = ndOrder.filter(item => item.pageconfigurationid)
|
|
|
+ store.dispatch('auth/changeAuthArrs', nd)
|
|
|
// const typeData = setType(treeData, 'up_auth_id', 'auth_id')
|
|
|
- const menusArray = parseMenuItem(ndOrder)
|
|
|
+ const menusArray = parseMenuItem(nd)
|
|
|
const treeMenu = listToTree(menusArray, 'up_auth_id', 'auth_id')
|
|
|
const dataMenu = _.unionBy(treeMenu, 'auth_id')
|
|
|
const menus = parseMenu(dataMenu)
|
|
|
- console.log(menus)
|
|
|
store.dispatch('permission/setRoutes', menus)
|
|
|
router.addRoutes(menus)
|
|
|
next({ ...to, replace: true })
|
|
|
} else {
|
|
|
- await store.dispatch('user/resetToken')
|
|
|
- Message.error(error || 'Has Error')
|
|
|
- next(`/login?redirect=${to.path}`)
|
|
|
- NProgress.done()
|
|
|
+ // await store.dispatch('user/resetToken')
|
|
|
+ // Message.error(error || 'Has Error')
|
|
|
+ // next(`/login?redirect=${to.path}`)
|
|
|
+ // NProgress.done()
|
|
|
+ next({ ...to, replace: true })
|
|
|
}
|
|
|
} catch (error) {
|
|
|
// remove token and go to login page to re-login
|