Browse Source

买卖家中心-账户管理-邮箱正则表达式修改

liusw 8 years ago
parent
commit
644332e061

+ 1 - 1
src/main/java/com/uas/platform/b2c/common/account/controller/UserController.java

@@ -258,7 +258,7 @@ public class UserController {
 			throw new IllegalOperatorException("新邮箱地址与旧邮箱地址相同");
 		}
 		// 正则校验邮箱地址
-		if(!newUserEmail.matches("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+")){
+		if(!newUserEmail.matches("^[A-Za-z0-9\\u4e00-\\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")){
 			throw new IllegalOperatorException("新邮箱地址格式不正确");
 		}
 		String _checkCode = (String) session.getAttribute("checkCode");

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js

@@ -809,7 +809,7 @@ define(['app/app'], function (app) {
           $scope.emailEnable = function (newUserEmail) {
             //邮箱不可用
             if ((newUserEmail == null || newUserEmail.length > 30)
-                || !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(
+                || !/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(
                     newUserEmail)) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js

@@ -750,7 +750,7 @@ define(['app/app'], function(app) {
           $scope.emailEnable = function (newUserEmail) {
             //邮箱不可用
             if ((newUserEmail == null || newUserEmail.length > 30)
-                || !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(
+                || !/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(
                     newUserEmail)) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;