fix: 统一管理端开发与部署路由契约
- 开发与生产统一使用 /flow/ 基路径和 Hash 路由 - 自动规范化本地根路径入口并补充契约测试
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user