فهرست منبع

fix: 修改正则表达式邮箱验证

Marko552 4 سال پیش
والد
کامیت
139a725e88

+ 1 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/FactoryServiceImpl.java

@@ -414,7 +414,7 @@ public class FactoryServiceImpl implements FactoryService {
                     if (StringUtils.isBlank(factoryProperty.getEmail())) {
                         errorMessage.append("邮箱").append("为空,");
                     }else {
-                        String emailFormatString = "^([a-zA-Z0-9_-]+(\\.?)[a-zA-Z0-9_-]+)+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]{1,10}+)+$";
+                        String emailFormatString = "^[a-z0-9A-Z]{1,50}+[- | a-z0-9A-Z . _]{0,50}+@([a-z0-9A-Z]{0,50}+(-[a-z0-9A-Z]+)?\\.)+[a-z]{1,10}$";
                         Pattern emailFormat = Pattern.compile(emailFormatString);
                         if (!emailFormat.matcher(factoryProperty.getEmail()).matches()) {
                             errorMessage.append("邮箱").append("格式不正确,");