Pārlūkot izejas kodu

admin-h5 构建产物打包至 car-wash-admin,统一部署

- vite.config.js:build 时 base 自动切换为 /h5/,outDir 指向
  car-wash-admin/src/main/resources/static/h5
- manifest.json:h5 router base 改为 /h5/,与部署路径一致
- 省去 H5 独立部署步骤,与 PC 管理端共用 JAR 包

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline 1 dienu atpakaļ
vecāks
revīzija
ca3a5ab89c
2 mainītis faili ar 16 papildinājumiem un 10 dzēšanām
  1. 1 1
      admin-h5/src/manifest.json
  2. 15 9
      admin-h5/vite.config.js

+ 1 - 1
admin-h5/src/manifest.json

@@ -18,7 +18,7 @@
         "usingComponents" : true,
         "router" : {
             "mode" : "hash",
-            "base" : "./"
+            "base" : "/h5/"
         },
         "title" : "自助洗车运营管理",
         "domain" : "",

+ 15 - 9
admin-h5/vite.config.js

@@ -1,15 +1,21 @@
 import { defineConfig } from 'vite'
 import uni from '@dcloudio/vite-plugin-uni'
 
-export default defineConfig({
-  plugins: [
-    uni()
-  ],
-  css: {
-    preprocessorOptions: {
-      scss: {
-        silenceDeprecations: ['legacy-js-api', 'import']
+export default defineConfig(({ command, mode }) => {
+  const isBuild = command === 'build'
+
+  return {
+    base: isBuild ? '/h5/' : './',
+    plugins: [uni()],
+    build: {
+      outDir: '../car-wash-admin/src/main/resources/static/h5'
+    },
+    css: {
+      preprocessorOptions: {
+        scss: {
+          silenceDeprecations: ['legacy-js-api', 'import']
+        }
       }
     }
   }
-})
+})