diff --git a/server/router/router.go b/server/router/router.go index 6b2ce66a303b052ae6c6aed5994f1f792776a037..a3cfe3b829bd4abd49f5f647d6a3f19537dc8cc1 100644 --- a/server/router/router.go +++ b/server/router/router.go @@ -82,7 +82,7 @@ func StaticRouter(router *gin.Engine) { // 解决页面刷新404的问题 router.NoRoute(func(c *gin.Context) { - logger.Error("process noroute: %s", c.Request.URL) + logger.Debug("process noroute: %s", c.Request.URL) if !strings.HasPrefix(c.Request.RequestURI, "/plugin/atune/*path") { c.File("../web/dist/index.html") return diff --git a/server/service/extentions.go b/server/service/extentions.go index 5d4b5119e76eebe5d4e260320707f7fb31ff1cd4..db2952f50ec372e8455da74967d0b741eb44b23b 100644 --- a/server/service/extentions.go +++ b/server/service/extentions.go @@ -22,13 +22,13 @@ func AddExtentions() { pe1 := &common.PageExtention{ Type: common.ExtentionPage, Name: "任务列表", - URL: "/plugin/atune/task", + URL: "/task", Permission: "plugin.prometheus.page/menu", } pe2 := &common.PageExtention{ Type: common.ExtentionPage, Name: "调优模板", - URL: "/plugin/atune/template", + URL: "/template", Permission: "plugin.prometheus.page/menu", } ex = append(ex, me1, me2, pe1, pe2) diff --git a/web/src/router/index.ts b/web/src/router/index.ts index c334947bc4315f8036d72c904f560cf2667bded5..f067e6e370fb02db0ecdd237f2ccf1ab0134f5ab 100644 --- a/web/src/router/index.ts +++ b/web/src/router/index.ts @@ -1,4 +1,4 @@ -import { createRouter, createWebHashHistory } from "vue-router"; +import { createRouter, createWebHistory } from "vue-router"; import type { RouteRecordRaw } from "vue-router"; import Home from "@/views/Home.vue"; import Atune from "@/views/atuneList.vue"; @@ -22,7 +22,7 @@ const routes: Array = [ ], }, { - path: "/atune", + path: "/template", component: Atune, meta: { title: "模板列表" }, children: [ @@ -33,15 +33,10 @@ const routes: Array = [ }, ], }, - { - path: "/result", - component: Result, - meta: { title: "结果展示" }, - }, ]; const router = createRouter({ - history: createWebHashHistory(), + history: createWebHistory(window.__MICRO_APP_BASE_ROUTE__ || '/'), routes, }); diff --git a/web/src/vite-env.d.ts b/web/src/vite-env.d.ts index 25d28cd1f93302523faab296a5b6ed0a1c4c1239..5018de31bd6728d0c32308abe6878c45bc25ec09 100644 --- a/web/src/vite-env.d.ts +++ b/web/src/vite-env.d.ts @@ -1 +1,7 @@ -declare module "*.vue"; \ No newline at end of file + +declare module "*.vue"; +interface Window { + remount: any; + unmount: any; + readonly '__MICRO_APP_BASE_ROUTE__': string +}