feat(api): 配置 LED 接口代理与请求地址

- 新增开发及生产环境 LED_API_URL,分别指向本地代理和远程服务器
- 修改 stopReplace 和 numberReplace 请求地址,使用 LED_API_URL,并绕过全局 baseURL
- 在 vite.config.ts 中添加 LED 大屏后端代理配置,支持跨域及路径重写
- 优化开发环境下的接口请求,避免跨域问题
This commit is contained in:
2026-07-20 11:11:57 +08:00
parent a7e88a8f0c
commit 4a91140a76
2 changed files with 17 additions and 5 deletions

View File

@@ -69,6 +69,13 @@ export default defineConfig(({ command, mode }) => {
cors: true, // 启用 CORS
// 代理配置
proxy: {
// LED 大屏后端代理
'/led-api': {
target: 'http://16.1.3.234:9200',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/led-api/, '/api')
},
'/api': {
target:
env.VITE_API_URL ||