mirror of
https://github.com/certd/certd.git
synced 2026-04-26 22:07:29 +08:00
fix: 修复邮箱包含.号校验失败的bug
This commit is contained in:
@@ -54,7 +54,9 @@ onMounted(async () => {
|
|||||||
async function addItem() {
|
async function addItem() {
|
||||||
const email = newEmail.value;
|
const email = newEmail.value;
|
||||||
//验证邮箱格式
|
//验证邮箱格式
|
||||||
if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(newEmail.value)) {
|
const regExp =
|
||||||
|
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/;
|
||||||
|
if (!regExp.test(email)) {
|
||||||
notification.error({
|
notification.error({
|
||||||
message: "请填写正确的邮箱地址",
|
message: "请填写正确的邮箱地址",
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user