正文 配置api请求到服务端进行跨域访问,前后端分离项目时用于测试数据。 配置文件.umirc.ts。 export default defineConfig({ proxy: { '/api': { target: 'http://localhost:3000', changeOrigin: true, //重写 pathRewrite: { '^/api': '' }, }, }, });