📅  最后修改于: 2022-03-11 14:56:49.378000             🧑  作者: Mango
axios returns data in the data object, go with:
const loginHandler = (e) => {
e.preventDefault();
try {
axios.post('http://localhost:5000/api/auth/login',
{
email,
password
}
).then(res => localStorage.setItem("refreshToken", res.data.refreshToken))
} catch (err) {
console.log(err)
}
}