【发布时间】:2019-08-14 16:38:07
【问题描述】:
我正在尝试调用 API 来验证用户。获得 200 成功响应,但未获得 JSESSIONID cookie 响应。
axios.defaults.withCredentials = 'true';
axios.defaults.crossDomain = 'true';
axios.defaults.headers.post['Content-Type'] = 'application/json';
axios.defaults.headers.post['withCredentials'] = 'true';
const data = {
username: this.state.user,
credential: this.state.pass
}
axios.post('http://3.122.7.162:5000/v60/admin/session', data)
.then(response => {
console.log("response");
console.log(response);
})
.catch(error => {
console.log("error");
console.log(error);
});
谢谢
【问题讨论】:
标签: javascript reactjs cookies axios