修改检测脚本新增页面路由权限

This commit is contained in:
GGJ
2025-02-18 08:51:20 +08:00
parent 6db4d79839
commit f860630bfb

View File

@@ -1,31 +1,31 @@
import { RouteRecordRaw } from "vue-router"; import { RouteRecordRaw } from 'vue-router'
import { HOME_URL, LOGIN_URL } from "@/config"; import { HOME_URL, LOGIN_URL } from '@/config'
export const Layout = () => import('@/layouts/index.vue'); export const Layout = () => import('@/layouts/index.vue')
/** /**
* staticRouter (静态路由) * staticRouter (静态路由)
*/ */
export const staticRouter: RouteRecordRaw[] = [ export const staticRouter: RouteRecordRaw[] = [
{ {
path: "/", path: '/',
redirect: HOME_URL, redirect: HOME_URL
}, },
{ {
path: LOGIN_URL, path: LOGIN_URL,
name: "login", name: 'login',
component: () => import("@/views/login/index.vue"), component: () => import('@/views/login/index.vue'),
meta: { meta: {
title: "登录", title: '登录'
}, }
}, },
{ {
path: "/layout", path: '/layout',
name: "layout", name: 'layout',
component: Layout, component: Layout,
children: [ children: [
{ {
path: "/plan", path: '/plan',
name: "plan", name: 'plan',
redirect: "/plan/planList", redirect: '/plan/planList',
children: [ children: [
// { // {
// path: "/plan/planList", // path: "/plan/planList",
@@ -85,54 +85,55 @@ export const staticRouter: RouteRecordRaw[] = [
// isKeepAlive: true, // isKeepAlive: true,
// }, // },
// }, // },
// 错误页面路由
{ {
path: "/machine/testScriptAdd", path: '/403',
name: "testScriptAdd", name: '403',
component: () => import("@/views/machine/testScript/components/testScriptPopup.vue"), component: () => import('@/components/ErrorMessage/403.vue'),
meta: { meta: {
title: "检测脚本配置", title: '403页面'
icon: "List", }
isLink: "", },
{
path: '/404',
name: '404',
component: () => import('@/components/ErrorMessage/404.vue'),
meta: {
title: '404页面'
}
},
{
path: '/500',
name: '500',
component: () => import('@/components/ErrorMessage/500.vue'),
meta: {
title: '500页面'
}
},
// Resolve refresh page, route warnings
{
path: '/:pathMatch(.*)*',
component: () => import('@/components/ErrorMessage/404.vue')
}
]
},
{
path: '/machine/testScriptAdd',
name: 'testScriptAdd',
component: () => import('@/views/machine/testScript/components/testScriptPopup.vue'),
meta: {
title: '检测脚本配置',
icon: 'List',
isLink: '',
hideTab: true, hideTab: true,
parentPath: '/machine/testScript', parentPath: '/machine/testScript',
isHide: false, isHide: false,
isFull: false, isFull: false,
isAffix: false, isAffix: false,
isKeepAlive: true, isKeepAlive: true
},
},
// 错误页面路由
{
path: "/403",
name: "403",
component: () => import("@/components/ErrorMessage/403.vue"),
meta: {
title: "403页面",
},
},
{
path: "/404",
name: "404",
component: () => import("@/components/ErrorMessage/404.vue"),
meta: {
title: "404页面",
},
},
{
path: "/500",
name: "500",
component: () => import("@/components/ErrorMessage/500.vue"),
meta: {
title: "500页面",
},
},
// Resolve refresh page, route warnings
{
path: "/:pathMatch(.*)*",
component: () => import("@/components/ErrorMessage/404.vue"),
},
],
} }
], }
}, ]
]; }
]