Эх сурвалжийг харах

feat: 支持二级目录部署并适配路由基础路径

李亚非 2 сар өмнө
parent
commit
55ae16181c

+ 1 - 1
.env.production

@@ -2,7 +2,7 @@
 VITE_USER_NODE_ENV = production
 
 # 公共基础路径
-VITE_PUBLIC_PATH = /
+VITE_PUBLIC_PATH = /group_web_merchant/
 
 # 路由模式
 # Optional: hash | history

+ 1 - 1
src/router/index.ts

@@ -2,7 +2,7 @@ import { createRouter, createWebHistory } from "vue-router";
 import { staticRouter, errorRouter } from "@/routers/modules/staticRouter";
 
 const router = createRouter({
-  history: createWebHistory(),
+  history: createWebHistory(import.meta.env.BASE_URL),
   routes: [...staticRouter, ...errorRouter]
 });
 

+ 2 - 0
src/typings/global.d.ts

@@ -54,7 +54,9 @@ declare interface ViteEnv {
   VITE_DEVTOOLS: boolean;
   VITE_PUBLIC_PATH: string;
   VITE_API_URL: string;
+  VITE_API_URL_PLATFORM: string;
   VITE_PROXY: [string, string][];
+  VITE_PROXY_AI: [string, string][];
   VITE_CODEINSPECTOR: boolean;
 }
 

+ 1 - 1
tsconfig.json

@@ -3,7 +3,7 @@
     "target": "ESNext",
     "useDefineForClassFields": true,
     "module": "ESNext",
-    "moduleResolution": "node",
+    "moduleResolution": "Bundler",
     "types": ["vite/client", "element-plus/global"],
 
     /* Strict Type-Checking Options */