报错为
DELETE /customers/del/5] missing csrf token. See https://eggjs.org/zh-cn/core/security.html#安全威胁csrf的防范
config.js配置完全打开了
config.cors = {
// {string|Function} origin: '*',
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
credentials: true
};
xframe: {
enable: false,
},
csrf: {
headerName: 'csrftoken',
ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
},
白名单也设置了,现在的问题是GET,PUT,POST都可以通过,唯独DELETE通不过,前台请求为axios.delete(ip + '/customers/del/' + id)
十分不理解!望高手指点!
看下 network 是不是没带上 header