module.exports = { devServer: { proxy: { '/java-api': { // 确保匹配请求路径前缀 target: 'http://localhost:8080', // 替换为实际后端地址 changeOrigin: true, pathRewrite: { '^/java-api': '' } // 去除路径前缀 }, '/api': { target: 'http://localhost:8080', changeOrigin: true, pathRewrite: { '^/api': '' } } } } }