This commit is contained in:
Baobhan Sith
2025-04-17 20:26:30 +08:00
parent 09cba0b3d3
commit 9eb0bcc5f3
40 changed files with 2607 additions and 326 deletions
+8
View File
@@ -17,7 +17,15 @@ export default defineConfig({
changeOrigin: true, // 需要虚拟主机站点
// 可选:如果后端 API 路径没有 /api 前缀,可以在这里重写路径
// rewrite: (path) => path.replace(/^\/api/, '')
},
// --- 新增开始 ---
// 将所有 /uploads 开头的请求也代理到后端服务器
'/uploads': {
target: 'http://localhost:3001', // 后端服务器地址
changeOrigin: true, // 对于静态资源通常也建议开启
// 通常不需要重写静态资源的路径
}
// --- 新增结束 ---
}
}
})