【修复】修复 #I73UGD 邮箱带有下划线无法校验成功的bug

pull/122/head
徐玉祥 2023-06-19 21:17:54 +08:00
parent 8cc6880b9e
commit 1c6abf5f3f
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@
*/ */
package vip.xiaonuo.common.util; package vip.xiaonuo.common.util;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.ReUtil; import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import vip.xiaonuo.common.exception.CommonException; import vip.xiaonuo.common.exception.CommonException;
@ -31,7 +32,7 @@ public class CommonEmailUtil {
* @date 2022/8/15 13:32 * @date 2022/8/15 13:32
**/ **/
public static boolean isEmail(String email) { public static boolean isEmail(String email) {
return ReUtil.isMatch("^[A-Za-z0-9\\u4e00-\\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", email); return Validator.isEmail(email);
} }
/** /**