VM2233:1未捕获(承诺中)语法错误:JSON中位于位置0的意外标记
}) ``在控制台中工作** VM2233:1未捕获(承诺中)语法错误:JSON中位于位置0的意外标记 **VM2233:1未捕获(承诺中)语法错误:JSON中位于位置0的意外标记,json,fetch-api,Json,Fetch Api,}) ``在控制台中工作** VM2233:1未捕获(承诺中)语法错误:JSON中位于位置0的意外标记 ** onSubmitSignIn = () => { fetch("http://localhost:3000/signin", { method: "post", headers: { "Content-Type": "application/json" }, body: JSON.strin
onSubmitSignIn = () => {
fetch("http://localhost:3000/signin", {
method: "post",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
email: this.state.signInEmail,
password: this.state.signInPass,
}),
})
.then((response) => response.json())
.then((user) => {
if (user.id) {
this.props.loadUser(user);
this.props.onRouteChange("home");
}
});