diff --git a/ui/package.json b/ui/package.json index d6ea02cc0b439b6802dd6e5335b6ee0e7adce1dd..ff46e2f1a93f9109b0bec391115871b959c278a8 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { - "name": "admin-antd-vue", - "description": "Vue3.x Antd Admin", + "name": "ZTF", + "description": "Zentao Test Framework", "version": "1.0.0", "private": true, "scripts": { diff --git a/ui/src/config/settings.ts b/ui/src/config/settings.ts index db92e69c7fc588a2fa7e788b225464aff691673b..b2ed82bc7bfe8d4e301c850f4073ea06a703b452 100644 --- a/ui/src/config/settings.ts +++ b/ui/src/config/settings.ts @@ -2,7 +2,6 @@ import { RoutesDataItem } from "@/utils/routes"; /** * 站点配置 - * @author LiQingSong */ export interface SettingsType { /** diff --git a/ui/src/utils/routes.ts b/ui/src/utils/routes.ts index 561afd9f087590878f4e6af3b639472ae5534a55..6d746eb533f53794ec10441c37f3861b71ef6ccb 100644 --- a/ui/src/utils/routes.ts +++ b/ui/src/utils/routes.ts @@ -89,6 +89,9 @@ import { equalObject } from "./object"; * @param routesData routes */ export const getRouteItem = (pathname: string, routesData: RoutesDataItem[]): RoutesDataItem => { + + console.log('getRouteItem', getRouteItem) + let item: RoutesDataItem = { title: '', path: '', redirect: '', roles: [] }; for (let index = 0, len = routesData.length; index < len; index += 1) { @@ -98,8 +101,8 @@ export const getRouteItem = (pathname: string, routesData: RoutesDataItem[]): Ro item = element; break; } else if (element.path.indexOf(':') > 0) { - const reg = new RegExp("((.+)(:[^/]+)(.*))","gmi"); - const path = element.path.replace(reg,"$2.+$4") + const reg = new RegExp("(:[^/]+)","gmi"); + const path = element.path.replaceAll(reg,".+") const pass = new RegExp(path).test(pathname) if (pass) {