修复: API配置和文件下载问题
- 修复生产环境API地址配置 (api.config.js) - 修复event-rules页面下载文件无后缀问题,H5环境使用a标签download属性 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,50 +1,28 @@
|
||||
/**
|
||||
* Vue CLI 配置文件
|
||||
* 用于配置开发服务器代理,解决跨域问题
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// 输出目录
|
||||
outputDir: 'dist/build/h5',
|
||||
|
||||
// 静态资源目录
|
||||
assetsDir: 'static',
|
||||
|
||||
// 公共路径 - 部署到服务器时的基础路径
|
||||
// 如果部署在根目录,使用 '/'
|
||||
// 如果部署在子目录,使用 '/子目录名/'
|
||||
publicPath: './',
|
||||
|
||||
productionSourceMap: false,
|
||||
css: {
|
||||
extract: true
|
||||
},
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
port: 8084,
|
||||
disableHostCheck: true,
|
||||
proxy: {
|
||||
// 代理所有 /api 开头的请求
|
||||
'/api': {
|
||||
target: 'http://localhost:8123', // 后端服务地址
|
||||
changeOrigin: true, // 改变请求源
|
||||
ws: true, // 支持websocket
|
||||
target: 'http://localhost:8123',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
pathRewrite: {
|
||||
// 将 /api 重写为空,因为后端没有 /api 前缀
|
||||
'^/api': ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 确保 transpileDependencies 配置正确
|
||||
transpileDependencies: [],
|
||||
|
||||
// 生产环境配置
|
||||
productionSourceMap: false,
|
||||
|
||||
// 禁用 gzip 大小报告,避免构建时的文件读取问题
|
||||
css: {
|
||||
extract: true
|
||||
},
|
||||
|
||||
chainWebpack: config => {
|
||||
// 禁用 gzip 大小报告
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config.performance.hints(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user