- 修复前端附件字段名 filePath -> fileUrl(管理后台expense/requirement) - 修复移动端附件上传字段名及预览逻辑(base64->URL) - 修复后端FileController下载接口支持COS文件重定向 - 修复其他前端API路径问题
33 lines
738 B
TypeScript
33 lines
738 B
TypeScript
import { defineConfig, loadEnv } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
// 加载环境变量
|
|
const env = loadEnv(mode, process.cwd())
|
|
const base = env.VITE_BASE || '/'
|
|
|
|
return {
|
|
// 部署路径前缀
|
|
base,
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src')
|
|
}
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
proxy: {
|
|
// 所有 /fund/ 请求代理到网关,去掉 /fund 前缀
|
|
'/fund/': {
|
|
target: 'http://localhost:8000',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/fund/, '')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|