141 lines
3.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const Layout = () => import("@themeDefault/layout/index.vue");
/**
* 全路由表(主题目录内的路由,仅需要返回数组即可,交给主框架进行路由重组)
* 必须依照以下格式配置
* path表示的是路径如”/“或"/login"或”/redirect/:path(.*)“
* {
* ":path":{
* component:"视图组件",
* meta:{
* hidden: bool 是否隐藏
* title: '页标题',
* icon: '图标配置,根据自己的主题来自行定义',
* roles: ['guest'] 权限角色组
* },
* children:{} 子路径,配置方式与父路径的要求是一样的
* }
* }
*/
const paths = {
"/redirect":{
path: "/redirect",
component: Layout,
meta: {
hidden: true,
title: "",
icon:"",
roles:["admin"]
},
children:{
"/redirect/:path(.*)":{
path: "/redirect",
component: () => import("@themeDefault/views/redirect/index.vue"),
meta: {
hidden: true,
title: "",
icon:"",
roles:["admin"]
}
},
}
},
"/login":{
path: "/login",
component: () => import("@themeDefault/views/login/index.vue"),
meta: {
hidden: true,
title: "登陆",
icon:"",
roles:["guest"]
}
},
"/":{
path: "/",
component: Layout,
redirect: "/dashboard",
meta: {
hidden: true,
title: "",
icon:"",
roles:["admin"]
},
children:{
"dashboard":{
path: "/redirect",
component: () => import("@themeDefault/views/dashboard/index.vue"),
// 用于 keep-alive 功能,需要与 SFC 中自动推导或显式声明的组件名称一致
// 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
meta: {
hidden: true,
title: "dashboard",
icon: "homepage",
affix: true,
keepAlive: true,
roles:["admin"]
}
},
"401":{
path: "401",
component: () => import("@themeDefault/views/error-page/401.vue"),
meta: {
hidden: true,
title: "",
icon:"",
roles:["guest"]
}
},
"404":{
path: "404",
component: () => import("@themeDefault/views/error-page/404.vue"),
meta: {
hidden: true,
title: "",
icon:"",
roles:["guest"]
}
},
// "/redirect":{
// path: "/redirect",
// component: Layout,
// meta: {
// hidden: true,
// title: "",
// icon:"",
// roles:["guest"]
// },
// },
//
// "/redirect/:path(.*)":{
// path: "/redirect",
// component: () => import("@themeDefault/views/redirect/index.vue"),
// meta: {
// hidden: true,
// title: "",
// icon:"",
// roles:["guest"]
// }
// },
//
// "/login":{
// path: "/login",
// component: () => import("@themeDefault/views/login/index.vue"),
// meta: {
// hidden: true,
// title: "登陆",
// icon:"",
// roles:["guest"]
// }
// },
}
},
};
export default paths;