|
@@ -49,7 +49,10 @@ router.beforeEach((to, from, next) => {
|
|
|
store.dispatch('GenerateRoutes', { roles })
|
|
store.dispatch('GenerateRoutes', { roles })
|
|
|
.then(routers => {
|
|
.then(routers => {
|
|
|
// 动态添加可访问路由表
|
|
// 动态添加可访问路由表
|
|
|
- router.addRoutes(routers)
|
|
|
|
|
|
|
+ // router.addRoutes(routers)
|
|
|
|
|
+ for (const x of routers) {
|
|
|
|
|
+ router.addRoute(x)
|
|
|
|
|
+ }
|
|
|
// 请求带有 redirect 重定向时,登录自动重定向到该地址
|
|
// 请求带有 redirect 重定向时,登录自动重定向到该地址
|
|
|
const redirect = decodeURIComponent(from.query.redirect || to.path)
|
|
const redirect = decodeURIComponent(from.query.redirect || to.path)
|
|
|
if (to.path === redirect) {
|
|
if (to.path === redirect) {
|