Codex Assistant
2025-11-06 375c18a6d2713ff19b22093eec57315992d8333f
web/vite.config.ts
@@ -10,13 +10,16 @@
    }
  },
  server: {
    port: 5173,
    host: '0.0.0.0',
    port: 3000,
    open: true,
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        // 将API代理回本地后端,便于完整联调(后端运行在 http://127.0.0.1:8080/api)
        target: 'http://127.0.0.1:8080',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '/api')
        secure: false,
        // 不需要重写路径,因为后端的context-path就是 /api
      }
    }
  },