修改src/main.js文件,不要引入permission
修改src/router/index.js文件,如果跟我的代码不一样,就完全换成图里的哈
- import { constantRouterMap,asyncRouterMap } from '@/config/router.config'
-
-
- export default new Router({
- mode: 'history',
- base:process.env.BASE_URL,
- scrollBehavior:()=>({y:0}),
- routes:constantRouterMap.concat(asyncRouterMap)
- })
- import { asyncRouterMap } from "@/config/router.config.js"
-
- created () {
- this.menus = asyncRouterMap.find(item => item.path === '/').children;
- this.collapsed = !this.sidebarOpened;
- }
修改 src/views/user/Login.vue文件
- handleSubmit (e) {
- e.preventDefault()
- const {
- form: { validateFields },
- state,
- customActiveKey,
- Login
- } = this
-
- state.loginBtn = true
-
- const validateFieldsKey = customActiveKey === 'tab1' ? ['username', 'password'] :['mobile', 'captcha']
- this.loginSuccess();
- }