修改路由

This commit is contained in:
aoli.qu 2021-09-09 09:09:29 +08:00
parent 078b82a541
commit 790a5f8488
1 changed files with 6 additions and 6 deletions

View File

@ -44,13 +44,13 @@ router.beforeEach((to, from, next) => {
store.dispatch('GenerateRoutes', { antDesignMenus }).then(() => {
// 根据菜单权限生成可访问的路由表
// 动态添加可访问路由表
const routes = store.getters.addRouters
for(let i =0,length =routes.length;i<length;i+=1){
const element = routes[i];
router.addRoute(element);
}
// const routes = store.getters.addRouters
// for(let i =0,length =routes.length;i<length;i+=1){
// const element = routes[i];
// router.addRoute(element);
// }
// router.addRoutes方法被遗弃
// router.addRoutes(store.getters.addRouters)
router.addRoutes(store.getters.addRouters)
// 请求带有 redirect 重定向时,登录自动重定向到该地址
const redirect = decodeURIComponent(from.query.redirect || to.path)