feat(practice): streamline pilot content operations

This commit is contained in:
2026-07-25 12:51:39 +08:00
parent 35b37b07f7
commit fa9d6da975
9 changed files with 380 additions and 24 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import path from 'path';
export default defineConfig(({ mode, command }) => {
const env = loadEnv(mode, process.cwd());
const proxyTarget = process.env.VITE_APP_PROXY_TARGET || env.VITE_APP_PROXY_TARGET || 'https://wygj-api.localhost';
const keepProxyPrefix = process.env.VITE_PROXY_KEEP_PREFIX === '1';
return {
// 部署生产环境和开发环境下的URL。
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
@@ -29,7 +30,7 @@ export default defineConfig(({ mode, command }) => {
changeOrigin: true,
secure: false,
ws: true,
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
rewrite: (path) => keepProxyPrefix ? path : path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
}
}
},