我的前端项目带有 react-js
和 laravel8
作为后端,当我将我的 js 文件放入资源文件夹并运行我的项目时,一切正常,但是当我运行 react-js 时幼虫包我收到了这个错误
POST http://127.0.0.1:8000/userManagement/deleteCharity 419 (unknown status)
这是请求
const CSRF = await getCSRF();
let formData = new FormData();
formData.append("charity_id", Number(id));
formData.append("_method", 'patch');
try {
const response = await axios({
method: "post",
url: `${BaseURL}/userManagement/deleteCharity`,
data: formData,
headers: { "Content-Type": "multipart/form-data", "X-CSRF-TOKEN": CSRF.data },
})
console.log(response);
console.log(response.data);
resetAll()
// console.log('reset====>', currentApp)
} catch (error) {
console.log(error);
}
它在邮递员中工作正常,但是 不知道怎么回事