Browse Source

pref: 处理邮箱问题

wangcz 7 years ago
parent
commit
ea62549e48

+ 4 - 2
src/main/webapp/resources/js/sso/controllers/staffManagementCtrl.js

@@ -248,10 +248,11 @@ define(['app/app'], function (app) {
                 toaster.pop('error', '请输入用户名信息');
                 return;
             }
-            if (!$scope.userTelSuccess && !$scope.userEmailSuccess) {
+            if (!$scope.userEmailSuccess || !$scope.userTelSuccess) {
                 toaster.pop('error', '请输入正确的信息后提交');
                 return;
             }
+            console.log($scope.newUser, $scope.userTelSuccess, $scope.userEmailSuccess)
             $scope.adding = true;
             $scope.loading = true;
             Enterprise.saveUser({}, $scope.newUser, function () {
@@ -262,7 +263,7 @@ define(['app/app'], function (app) {
                 $scope.tableParams.page(1);
                 $scope.tableParams.reload();
                 $scope.adding = false;
-                // $scope.newUserForm.newUserTel.$setValidity('available', false);
+                $scope.newUserForm.newUser.userTel.$setValidity('available', false);
                 // $scope.newUserForm.newUserEmail.$setValidity('available', false);
                 $scope.userTelSuccess = false;
                 $scope.userTelError = false;
@@ -367,6 +368,7 @@ define(['app/app'], function (app) {
          */
         $scope.emailValid = function (email) {
             var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
+            console.log(email)
             if (email) {
                 reg.test(email) ? $scope.userEmailSuccess = true : $scope.userEmailSuccess = false;
             } else {

+ 3 - 1
src/main/webapp/resources/view/sso/staffManagement.html

@@ -968,12 +968,14 @@
                         <!--</td>-->
                         <td ng-class="{'has-error': userTelError, 'has-success': userTelSuccess}">
                             <input ng-model="newUser.userTel"
+                                   autocomplete="off"
                                    ng-blur="telValid(newUser.userTel)" required name="newUserTel"
                                    ng-pattern="/^1\d{10}$/" type="text" placeholder="手机">
                         </td>
                         <td ng-class="{'has-error': userEmailError, 'has-success': userEmailSuccess}">
-                            <input ng-model="newUser.userEmail" ng-pattern="/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/"
+                            <input ng-model="newUser.userEmail"
                                    ng-blur="emailValid(newUser.userEmail)"
+                                   autocomplete="off"
                                    name="newUserEmail" type="text"
                                    placeholder="邮箱">
                         </td>