| const { defineConfig } = require('@vue/cli-service')
|
| module.exports = defineConfig({
|
| transpileDependencies: true,
|
| /* dev 服务只跑在 8080;真正的后端地址改用
|
| 环境变量 VUE_APP_BACKEND,默认仍指向 8081 */
|
| // ❶ 统一以 /api 开头的请求全部反向代理
|
| target: process.env.VUE_APP_BACKEND || 'http://localhost:8081',
|
| /category、/torrent、/auth 旧写法,保留兼容性。
|
| target: process.env.VUE_APP_BACKEND || 'http://localhost:8081',
|
| pathRewrite: { '^/category': '/api/category' }
|
| target: process.env.VUE_APP_BACKEND || 'http://localhost:8081',
|
| pathRewrite: { '^/torrent': '/api/torrent' }
|
| target: process.env.VUE_APP_BACKEND || 'http://localhost:8081',
|
| pathRewrite: { '^/auth': '/api/auth' }
|