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");
}
});
};
``磨损在控制台**
VM2233:1 Uncaught (in promise) SyntaxError: Unexpected token s in JSON at position 0
**