更新时间:2023-12-04 08:19:28
axios.post期望(URL,数据,配置).
axios.post expects (url, data, config).
所以您需要这样使用:
axios.post(
"http://127.0.0.1:8000/users/password/change/",
{
new_password1: newPassword1,
new_password2: newPassword2
},
{
headers: {
"Content-type": "application/json",
"Authorization": `Token ${token}`
}
}
);
文档: