通知用户电子邮件已经存在。?

时间:2021-07-04 09:07:08

标签: javascript reactjs

社区,我正在开发一个您可以注册和登录的用户应用程序,我使用带有 UNIQUE: TRUE 属性的 React、RDX、SQL。为避免重复发邮件,DDBB 中不接受邮件,但浏览器已注册邮件通知不会打印在屏幕上。我不知道我是跳过一个步骤还是正则表达式错误地位于我的代码中,我将代码留在邮件正则表达式的位置。在此先感谢您的帮助!

const [, setError] = useState([]);

axios
  .post("http://localhost:3006/users", body)
  .then((res) => {
    setDatosUser(res.data.results);
    })
    .catch((err) => {
      var errorText = err.response.data.message;
        if (errorText?.includes("email")){
              setError(JSON.stringify("El email ya esta registrado."));

        } else if (errorText?.includes("phone")){
              setError(JSON.stringify("El telefono ya esta registrado."));
        }else{
              setError(JSON.stringify(err.response.data.message));
        }
          return Error("Files not Found");
        });
          history.push("/login");```



0 个答案:

没有答案
相关问题