1.跨域forbidden 狀態(tài)碼405
使用egg-cors
npm install egg-cors --save
plugin.js中添加配置
exports.cors = {
? enable: true,
? package: 'egg-cors',
};
config.default.js中添加配置
config.cors = {
? allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
}
使用egg-cors
npm install egg-cors --save
plugin.js中添加配置
exports.cors = {
? enable: true,
? package: 'egg-cors',
};
config.default.js中添加配置
config.cors = {
? allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
}