|
|
|
@ -46,6 +46,7 @@ export const constantRoutes = [
@@ -46,6 +46,7 @@ export const constantRoutes = [
|
|
|
|
|
{ |
|
|
|
|
path: '/', |
|
|
|
|
component: Layout, |
|
|
|
|
redirect: '/homepage', |
|
|
|
|
children: [{ |
|
|
|
|
path: 'homepage', |
|
|
|
|
name: 'Homepage', |
|
|
|
@ -54,13 +55,14 @@ export const constantRoutes = [
@@ -54,13 +55,14 @@ export const constantRoutes = [
|
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: '/', |
|
|
|
|
path: '/filemange', |
|
|
|
|
component: Layout, |
|
|
|
|
redirect: '/filemange/index', |
|
|
|
|
meta: { title: '文件管理', icon: 'el-icon-s-help' }, |
|
|
|
|
children: [ |
|
|
|
|
{ |
|
|
|
|
path: 'filemange', |
|
|
|
|
name: 'filemange', |
|
|
|
|
path: 'index', |
|
|
|
|
name: 'Filemange', |
|
|
|
|
component: () => import('@/views/filemange/index'), |
|
|
|
|
meta: { title: '', icon: 'dashboard' } |
|
|
|
|
}, |
|
|
|
@ -73,28 +75,22 @@ export const constantRoutes = [
@@ -73,28 +75,22 @@ export const constantRoutes = [
|
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: '/', |
|
|
|
|
path: '/usermange', |
|
|
|
|
component: Layout, |
|
|
|
|
children: [{ |
|
|
|
|
path: 'usermange', |
|
|
|
|
name: 'usermange', |
|
|
|
|
children: [ |
|
|
|
|
{ |
|
|
|
|
path: 'index', |
|
|
|
|
name: 'Usermange', |
|
|
|
|
component: () => import('@/views/usermanage/index'), |
|
|
|
|
meta: { title: '用户管理', icon: 'dashboard' } |
|
|
|
|
}] |
|
|
|
|
meta: { title: '用户管理', icon: 'form' } |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
// {
|
|
|
|
|
// path: '/',
|
|
|
|
|
// component: Layout,
|
|
|
|
|
// children: [{
|
|
|
|
|
// path: 'subfile',
|
|
|
|
|
// name: 'Subfile',
|
|
|
|
|
// component: () => import('@/views/subfile/index'),
|
|
|
|
|
// meta: { title: '文件管理', icon: 'dashboard' }
|
|
|
|
|
// }]
|
|
|
|
|
// },
|
|
|
|
|
{ |
|
|
|
|
path: '/systme', |
|
|
|
|
component: Layout, |
|
|
|
|
redirect: '/systme/changepass', |
|
|
|
|
name: 'systme', |
|
|
|
|
meta: { title: '系统管理', icon: 'el-icon-s-help' }, |
|
|
|
|
children: [ |
|
|
|
@ -118,77 +114,24 @@ export const constantRoutes = [
@@ -118,77 +114,24 @@ export const constantRoutes = [
|
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: 'external-link', |
|
|
|
|
component: Layout, |
|
|
|
|
children: [ |
|
|
|
|
{ |
|
|
|
|
path: 'https://dev.filesite.io/', |
|
|
|
|
meta: { title: '前端展示页面', icon: 'link' } |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 404 page must be placed at the end !!!
|
|
|
|
|
{ path: '*', redirect: '/404', hidden: true } |
|
|
|
|
// 404 page must be placed at the end !!!
|
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
const createRouter = (a) => new Router({ |
|
|
|
|
//mode: 'history', // require service support
|
|
|
|
|
const createRouter = () => new Router({ |
|
|
|
|
//mode: 'history', // require service supportmode: 'history',
|
|
|
|
|
scrollBehavior: () => ({ y: 0 }), |
|
|
|
|
routes: a |
|
|
|
|
routes: constantRoutes |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//let router
|
|
|
|
|
const router = createRouter(constantRoutes) |
|
|
|
|
// 动态添加路由
|
|
|
|
|
// import { mirlist } from '@/api/user'
|
|
|
|
|
// let pachs = () => import('@/views/filemange/index');
|
|
|
|
|
// mirlist().then(response => {
|
|
|
|
|
// let datamain = response.data;
|
|
|
|
|
// //routesData(datamain.data.menus);
|
|
|
|
|
// //console.log(response);
|
|
|
|
|
// datamain.data.menus.forEach(item => {
|
|
|
|
|
// menus.push(
|
|
|
|
|
// {
|
|
|
|
|
// path: item.directory,
|
|
|
|
|
// name: item.directory,
|
|
|
|
|
// component: pachs,
|
|
|
|
|
// meta: { title: item.directory, icon: 'dashboard' }
|
|
|
|
|
// }
|
|
|
|
|
// );
|
|
|
|
|
// });
|
|
|
|
|
// //console.log(menus);
|
|
|
|
|
// //router = createRouter(constantRoutes)
|
|
|
|
|
// console.log(router.options);
|
|
|
|
|
// router = createRouter(constantRoutes)
|
|
|
|
|
// // {
|
|
|
|
|
// // path: 'filemange',
|
|
|
|
|
// // name: 'Filemange',
|
|
|
|
|
// // component: () => import('@/views/filemange/index'),
|
|
|
|
|
// // meta: { title: '文件管理', icon: 'dashboard' }
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
|
|
// }).catch(function (error) {
|
|
|
|
|
// Message({
|
|
|
|
|
// showClose: true,
|
|
|
|
|
// message: error,
|
|
|
|
|
// type: 'error'
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
//router = createRouter(constantRoutes)
|
|
|
|
|
//router.addRoutes(constantRoutes);
|
|
|
|
|
|
|
|
|
|
const router = createRouter() |
|
|
|
|
|
|
|
|
|
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
|
|
|
|
export function resetRouter() { |
|
|
|
|
const newRouter = createRouter() |
|
|
|
|
router.matcher = newRouter.matcher // reset router 重置路由器
|
|
|
|
|
router.matcher = newRouter.matcher // reset router
|
|
|
|
|
} |
|
|
|
|
// router.reloadRouter = function () {
|
|
|
|
|
// router.matcher = new Router({
|
|
|
|
|
// mode: "history",
|
|
|
|
|
// constantRoutes
|
|
|
|
|
// }).matcher
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
export default router |
|
|
|
|