From 2b704445446237ae5645bd387c9d60a30a6ecd13 Mon Sep 17 00:00:00 2001 From: tanghaolin <1723298894@qq.com> Date: 星期四, 13 二月 2025 22:20:49 +0800 Subject: [PATCH] 修改路由重定向路径 --- src/router/index.ts | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index b0fb090..555917a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,10 +1,14 @@ -import { createRouter, createWebHistory } from 'vue-router'; +import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'; const router = createRouter({ - history: createWebHistory('./'), + history: createWebHashHistory(), routes: [ { - path: '/', + path: "/:path(.*)*", + redirect: "/home", + }, + { + path: '/home', name: 'home', component: () => import('../views/Home.vue'), }, -- Gitblit v1.9.3