代码提交-3-13

This commit is contained in:
2026-03-13 14:32:43 +08:00
parent dba9080e8c
commit 68b50e2577
39 changed files with 5658 additions and 922 deletions

View File

@@ -5,11 +5,13 @@ import createVitePlugins from './vite/plugins'
// https://vitejs.dev/config/
export default defineConfig(({ mode, command }) => {
const env = loadEnv(mode, process.cwd())
const { VITE_APP_ENV } = env
const { VITE_APP_ENV, VITE_APP_CAS_ENABLE } = env
return {
// 部署生产环境和开发环境下的URL.
base: VITE_APP_ENV === 'production' ? '/' : '/',
// 根据 .env 中的 CAS 开关动态设置 base 路径
// 注意:不要从 src/settings 引入,因为 vite 配置运行在 Node 环境,无法使用 import.meta.env
base: VITE_APP_ENV === 'production' ? ((VITE_APP_CAS_ENABLE === 'true') ? '/cas/' : '/srs/') : '/',
plugins: createVitePlugins(env, command === 'build'),
resolve: {
// https://cn.vitejs.dev/config/#resolve-alias
@@ -26,8 +28,8 @@ export default defineConfig(({ mode, command }) => {
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api': {
target: 'http://localhost:8080', // 测试
// target: 'http://172.16.129.101:8080', // 正式环境
// target: 'http://localhost:8080', // 测试
target: 'http://172.16.129.101:8080', // 正式环境
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
},