Ant Design Vue Pro去掉权限和登录页面直接进入系统
1、去除路由守卫在src/main.js文件里面去掉import './permission' // permission control2、让菜单生成不经过动态路由在src/router/index.js文件改为:import Vue from 'vue'import Router from 'vue-router'import { constantRouterMap, ...
·
1、去除路由守卫
在src/main.js文件里面去掉
import './permission' // permission control
2、让菜单生成不经过动态路由
在src/router/index.js文件改为:
import Vue from 'vue'
import Router from 'vue-router'
import { constantRouterMap, asyncRouterMap } from '@/config/router.config'
Vue.use(Router)
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
scrollBehavior: () => ({ y: 0 }),
routes: constantRouterMap.concat(asyncRouterMap)
})
3、菜单
在src\layouts\BasicLayout.vue 中引入 import { asyncRouterMap } from '@/config/router.config.js'
created 函数修改为:
created () {
this.menus = asyncRouterMap.find((item) => item.path === '/').children
this.collapsed = !this.sidebarOpened
},
注:参考https://blog.csdn.net/freewebsys/article/details/88361751
更多推荐
已为社区贡献5条内容
所有评论(0)