1、为什么在发送请求的时候会收不到cookie
一般情况下我们会这样使用
const data = await fetch('/mall/point/exchangecheck', {
body: JSON.stringify(dataObj),
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
}).catch(e => {
console.log(e);
toast({
'message': '网络异常'
});
});
fetch();
针对这个情况我们要这样使用
const data = await fetch('/mall/point/exchangecheck', {
body: JSON.stringify(dataObj),
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
credentials: "same-origin",
}).catch(e => {
console.log(e);
toast({
'messag