0
阵营母语JWT-AUTH错误获取API反应本地JWT-AUTH错误获取API
我试图通过使用JWT-AUTH,通过以下方法来获取用户的细节。
login() {
alert(this.state.UserName);
fetch (Api+''+'/wp-json/jwt-auth/v1/token',{
method: "POST",
username: this.state.UserName,
password: this.state.Password
}).then((response) => response.json())
.then((responseData) =>{
console.log("LoginData:-" + JSON.stringify(responseData));
}).done();
}
}
,并收到错误: -
{
"code":"[jwt_auth] empty_username",
"message":"<strong>ERROR</strong>: The username field is empty.",
"data":{"status":403}
}
如果有谁知道请帮助。