fix: 统一管理端开发与部署路由契约

- 开发与生产统一使用 /flow/ 基路径和 Hash 路由

- 自动规范化本地根路径入口并补充契约测试
This commit is contained in:
2026-07-24 19:00:47 +08:00
parent 63eb55e24c
commit a75f7baf1b
8 changed files with 211 additions and 13 deletions

View File

@@ -2,6 +2,8 @@ import { defineConfig } from '@easyflow/vite-config';
import ElementPlus from 'unplugin-element-plus/vite';
import { createBasePathRedirectPlugin } from './vite-base-path-redirect';
export default defineConfig(async () => {
return {
application: {},
@@ -14,6 +16,7 @@ export default defineConfig(async () => {
},
},
plugins: [
createBasePathRedirectPlugin(),
ElementPlus({
format: 'esm',
}),
@@ -22,19 +25,31 @@ export default defineConfig(async () => {
proxy: {
'/flow/api': {
changeOrigin: true,
headers: {
'X-Forwarded-Prefix': '/flow',
},
rewrite: (path) => path.replace(/^\/flow/, ''),
target: 'http://127.0.0.1:8111',
ws: true,
xfwd: true,
},
'/flow/public-api': {
changeOrigin: true,
headers: {
'X-Forwarded-Prefix': '/flow',
},
rewrite: (path) => path.replace(/^\/flow/, ''),
target: 'http://127.0.0.1:8111',
xfwd: true,
},
'/flow/userCenter': {
changeOrigin: true,
headers: {
'X-Forwarded-Prefix': '/flow',
},
rewrite: (path) => path.replace(/^\/flow/, ''),
target: 'http://127.0.0.1:8111',
xfwd: true,
},
},
},