111
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
import { setRouteEmitter } from "@/utils/route-listener"
|
||||
import setupUserLoginInfoGuard from "./userLoginInfo"
|
||||
import setupPermissionGuard from "@/router/guard/permisstion"
|
||||
// 导入设置title的工具
|
||||
import { setRouteTitle } from "@/utils/title"
|
||||
|
||||
function setupPageGuard(router) {
|
||||
router.beforeEach(async (to) => {
|
||||
// 发出路由改变的事件
|
||||
setRouteEmitter(to)
|
||||
})
|
||||
// 设置站点document.title
|
||||
router.afterEach((to, from) => {
|
||||
setRouteTitle(to.meta.title)
|
||||
})
|
||||
}
|
||||
|
||||
export default function createRouteGuard(router) {
|
||||
|
||||
@@ -8,7 +8,8 @@ const DASHBOARD = {
|
||||
requiresAuth: true,
|
||||
icon: "icon-home",
|
||||
order: 99,
|
||||
locale: "首页"
|
||||
locale: "首页",
|
||||
title: "首页"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -19,7 +20,8 @@ const DASHBOARD = {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "工作台",
|
||||
icon: "icon-dashboard"
|
||||
icon: "icon-dashboard",
|
||||
title: "工作台"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -30,7 +32,8 @@ const DASHBOARD = {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "用户中心",
|
||||
icon: "icon-user"
|
||||
icon: "icon-user",
|
||||
title: "用户中心"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -41,9 +44,10 @@ const DASHBOARD = {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "用户管理",
|
||||
icon: "icon-user-group"
|
||||
icon: "icon-user-group",
|
||||
title: "用户管理"
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ const DATAMANAGE = {
|
||||
requiresAuth: true,
|
||||
icon: "icon-storage",
|
||||
order: 99,
|
||||
locale: "数据管理"
|
||||
locale: "数据管理",
|
||||
title: "数据管理"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -19,7 +20,8 @@ const DATAMANAGE = {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "字典管理",
|
||||
icon: "icon-book"
|
||||
icon: "icon-book",
|
||||
title: "字典管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -30,7 +32,8 @@ const DATAMANAGE = {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "项目联系信息",
|
||||
icon: "icon-phone"
|
||||
icon: "icon-phone",
|
||||
title: "项目联系信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -41,7 +44,8 @@ const DATAMANAGE = {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "缩略语",
|
||||
icon: "icon-scissor"
|
||||
icon: "icon-scissor",
|
||||
title: "缩略语"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -8,18 +8,44 @@ const TESTMANAGE = {
|
||||
requiresAuth: true,
|
||||
icon: "icon-desktop",
|
||||
order: 1,
|
||||
locale: "监控"
|
||||
locale: "日志监控",
|
||||
title: "日志监控"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "operationLog",
|
||||
name: "OperationLog",
|
||||
name: "operationLog",
|
||||
component: () => import("@/views/monitor/operationLog/index.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "操作日志",
|
||||
icon: "icon-robot"
|
||||
locale: "数据操作日志",
|
||||
icon: "icon-file",
|
||||
title: "数据操作日志"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "operations",
|
||||
name: "operations",
|
||||
component: () => import("@/views/monitor/operations/index.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "接口操作日志",
|
||||
icon: "icon-file",
|
||||
title: "接口操作日志"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "loginLog",
|
||||
name: "loginLog",
|
||||
component: () => import("@/views/monitor/loginLog/index.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "登录日志",
|
||||
icon: "icon-file",
|
||||
title: "登录日志"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -8,7 +8,8 @@ const TESTMANAGE = {
|
||||
requiresAuth: true,
|
||||
icon: "icon-apps",
|
||||
order: 98,
|
||||
locale: "测试管理"
|
||||
locale: "测试管理",
|
||||
title: "测试管理"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -19,7 +20,8 @@ const TESTMANAGE = {
|
||||
requiresAuth: true,
|
||||
roles: ["*"],
|
||||
locale: "项目管理",
|
||||
icon: "icon-folder"
|
||||
icon: "icon-folder",
|
||||
title: "项目管理"
|
||||
}
|
||||
},
|
||||
// 二级路由(非三级路由,但是想办法把左侧菜单删除)
|
||||
@@ -34,7 +36,8 @@ const TESTMANAGE = {
|
||||
icon: "icon-folder",
|
||||
hideInMenu: true,
|
||||
ignoreCache: false,
|
||||
noAffix: true
|
||||
noAffix: true,
|
||||
title: "项目看板"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user