javascript - 通知用户该电子邮件已经存在。?
问题描述
社区,我正在开发一个用户应用程序,您可以注册和登录,我使用 React、RDX、SQL 和 UNIQUE: TRUE 属性。为避免重复发送邮件,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");```
解决方案
推荐阅读
- r - 使用多个几何图形时如何消除ggplotly重复的图例条目
- google-cloud-functions - Google Dialogflow:无法读取未定义的属性“EventInput”
- typescript - 即时将 JSON Schema 对象转换为 Typescript 类型
- django - Django 和具有写入实例 + 多个读取副本的数据库——运行 Celery 作业
- r - 与涉及 ridge_models 的错误作斗争
- vue.js - TypeError:无法设置未定义的属性(设置“授权”)
- java - 直接调用@Bean注解的方法——函数调用@Service类中的一个bean
- javascript - 单击当前按钮时无法设置计数器
- google-sheets - 用于查找逗号分隔的 SKU 数组并返回与 SKU 关联的产品名称的电子表格公式
- mysql - 从当前月份和前 6 个月开始每月计数一列(包括空值)?