我正在try 使用REACTIVE js运行删除查询.在Postman中,我的删除查询正在工作,但在我的代码中,它显示没有授权
我做了
console.log(headers)
判断标头是否可用,但仍不起作用.我已经把我试过的东西贴出来了
const deletefile = (e) => {
const headers = {
Authorization: `Token ${sessionStorage.getItem("token")}`,
};
console.log(headers);
const Data = {
id: e,
// // stage: "stage9",
// notes: notes,
};
axios
.delete("file/", Data, {
headers: headers,
})
.then(() => {
alert("success submited");
// setRefresh(Refresh + 1);
})
.catch((error) => {
alert(error);
});