Files
TDMFBJ_TH/vue/vue.config.js

29 lines
809 B
JavaScript
Raw Normal View History

2025-07-24 12:00:08 +08:00
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
transpileDependencies: true,
});
2025-07-24 16:51:31 +08:00
const port = 1573;
2025-07-24 12:00:08 +08:00
module.exports = {
devServer: {
2025-07-24 16:51:31 +08:00
port: port,
2025-07-24 12:00:08 +08:00
proxy: {
'/api': {
2025-07-24 16:51:31 +08:00
target: 'http://127.0.0.1:10002', // 后端接口的地址
2025-07-24 12:00:08 +08:00
changeOrigin: true,
pathRewrite: {
'^/api': '', // 如果您的后端API路径不包含'/api',可以删除这一行
},
},
// 特殊代理规则(直接发送到后端的 POST 请求)
// '/admin/upload': {
// target: 'http://192.168.10.20:10002', // 直接发送到后端的地址
// changeOrigin: true,
// pathRewrite: {
// '^/admin/upload': '' // 重写路径,去掉 /admin/upload 前缀
// }
// },
},
},
};