import { createRouter, createWebHashHistory } from "vue-router"; import type { RouteRecordRaw } from "vue-router"; /** * 智能助手路由:单页应用,唯一入口为对话页。 * 用 hash 模式:产物部署在 /{contextPath}/front/ 下,无需服务端 rewrite 规则。 */ const routes: RouteRecordRaw[] = [ { path: "/", name: "chat", component: () => import("@/views/Chat.vue"), meta: { title: "智能助手" }, }, { path: "/:pathMatch(.*)*", redirect: "/" }, ]; const router = createRouter({ history: createWebHashHistory(), routes, }); export default router;