VM2233:1 Uncaught (in promise) SyntaxError: Unexpected token s in JSON at position 0

时间:2021-06-01 18:15:00

标签: json fetch-api

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

**

0 个答案:

没有答案