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