企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
plugin.ts 添加如下配置 ``` cors: { enable: true, package: 'egg-cors', }, ``` config.default.ts ``` config.security = { domainWhiteList: ['http://localhost:8889', 'http://app.usexcx.com'], csrf: { enable: false, }, }; ``` 由于前端设置了Access-Control-Allow-Origin:* 后端不能设置* axios前端开启withCredentials: true 后端必须配置credentials: true, ``` config.cors = { credentials: true, // origin: '\*', // allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH' }; ```