Codex Assistant
1 天以前 9d9519354fb304855258a5c97e26dd12c3caf5e1
fix: 修复前端代理配置,移除不必要的API路径重写规则

- 注释掉vite.config.ts中/api路径的rewrite规则
- 后端context-path已包含/api前缀,无需前端重写
- 修复前端登录API调用问题
1个文件已修改
3 ■■■■ 已修改文件
web/vite.config.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/vite.config.ts
@@ -16,7 +16,8 @@
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '/api')
        // 不需要重写路径,因为后端的context-path就是/api
        // rewrite: (path) => path.replace(/^\/api/, '/api')
      }
    }
  },