vite配置代理,target失效 配置的baseUrl // config.js export const BASE_URL = '/api' 这是vite.config.js server的配置 // vite.config.js export default defineConfig({ server: { host: '0.0.0.0', port: 3060, proxy: { '/api': { target: 'http://127.0.0.1:10306', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') } } } }) 调用请求后target指向前端地址[http://localhost:3060](https://link.segmentfault.com/?enc=BCyhYL1UR1DGMDS%2FRuDROg%3D%3D.oIlHqb8uCLmvbIMoek1ob8LnpQ3psfROU8asmirpcmE%3D),没有指向配置的后端target.   使用vite issues中的agent配置依旧无法解决[ [vite] http proxy error #8998]([https://github.com/vitejs/vite/discussions/8998](https://link.segmentfault.com/?enc=S%2F4vXe5x37znSEzd2e97Ug%3D%3D.zVNsp%2F30eTCG%2FttzK2tifwWH63C1lWOXWPgr7mZlgOSIcQgQHM0zZhMRu2NiGcR3))