添加前端

This commit is contained in:
橙子
2022-04-26 01:34:47 +08:00
parent f3061ed643
commit 630cfb6769
99 changed files with 5239 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import { trailingSlash } from '@/util/helpers'
import {
layout,
route,
} from '@/util/routes'
Vue.use(VueRouter)
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
scrollBehavior: (to, from, savedPosition) => {
if (to.hash) return { selector: to.hash }
if (savedPosition) return savedPosition
return { x: 0, y: 0 }
},
routes: [
layout('Default', [
route('Index'),
route('AdmUser', null, 'AdmUser'),
route('AdmRole', null, 'AdmRole'),
route('AdmMenu', null, 'AdmMenu'),
route('AdmMould', null, 'AdmMould'),
route('AdmRoleMenu', null, 'AdmRoleMenu'),
route('userInfo', null, 'userInfo'),
route('Pan',null,'pan'),
route('PanInfo',null,'PanInfo')
]),
layout('Login', [
route('login', null, 'login'),
route('register', null, 'register')
])
]
})
router.beforeEach((to, from, next) => {
return to.path.endsWith('/') ? next() : next(trailingSlash(to.path))
})
export default router