Browse Source

Merge remote-tracking branch 'origin/release-201846-wangcz' into release-201846-wangcz

shenjunjie 7 years ago
parent
commit
c2ee84b8aa

+ 3 - 0
src/main/webapp/resources/js/common/controllers/commonCtrls.js

@@ -42,6 +42,9 @@ define([ 'app/app' ], function(app) {
 				if(cfg.url && !isInArr(cfg.url)) {
 					startLoading();
 				}
+				if (cfg.url.indexOf('/UBTOB')) {
+					cfg.url = cfg.url.replace('/UBTOB', '')
+				}
 				return cfg;
 			},
 			requestError: function(rejection) {

+ 5 - 5
src/main/webapp/resources/js/common/services.js

@@ -152,15 +152,15 @@ define([ 'angular', 'common/utils', 'big'], function(angular, utils, Big) {
 					// 	$rootScope.b2bUrl = resolve.url;
 					// });
 					if (this.getRootPath().indexOf('test-b2c.uuzcc.cn') > -1 || this.getRootPath().indexOf('test-mall.uuzcc.cn') > -1) {
-                        $rootScope.b2bUrl = 'https://test-b2b.uuzcc.cn'
+                        $rootScope.b2bUrl = 'https://test-b2b.uuzcc.cn/UBTOB'
 					} else if (this.getRootPath().indexOf('rel-b2c.uuzcc.cn') > -1 || this.getRootPath().indexOf('rel-mall.uuzcc.cn') > -1) {
-                        $rootScope.b2bUrl = 'https://rel-b2b.uuzcc.cn'
+                        $rootScope.b2bUrl = 'https://rel-b2b.uuzcc.cn/UBTOB'
                     } else if (this.getRootPath().indexOf('pre-b2c.uuzcc.cn') > -1 || this.getRootPath().indexOf('pre-mall.uuzcc.cn') > -1) {
-                        $rootScope.b2bUrl = 'https://pre-b2b.uuzcc.cn'
+                        $rootScope.b2bUrl = 'https://pre-b2b.uuzcc.cn/UBTOB'
                     } else if (this.getRootPath().indexOf('b2c.usoftchina.com') > -1 || this.getRootPath().indexOf('mall.usoftchina.com') > -1) {
-                        $rootScope.b2bUrl = 'https://b2b.usoftchina.com'
+                        $rootScope.b2bUrl = 'https://b2b.usoftchina.com/UBTOB'
 					} else {
-                        $rootScope.b2bUrl = 'http://10.1.51.125:8090/platform-b2b/'
+                        $rootScope.b2bUrl = 'http://10.1.51.125:8090/platform-b2b/UBTOB'
 					}
 				}
 				return $rootScope.b2bUrl;

+ 32 - 25
src/main/webapp/resources/js/sso/controllers/staffManagementCtrl.js

@@ -13,6 +13,7 @@ define(['app/app'], function (app) {
             $scope.addingUser = status;
             $scope.adding = false;
             $scope.newUser = {};
+            $scope.newUser.userName = '';
             $scope.newUser.userTel = '';
             $scope.newUser.userEmail = '';
         };
@@ -247,7 +248,7 @@ define(['app/app'], function (app) {
                 toaster.pop('error', '请输入用户名信息');
                 return;
             }
-            if (!$scope.userTelSuccess) {
+            if (!$scope.userTelSuccess && !$scope.userEmailSuccess) {
                 toaster.pop('error', '请输入正确的信息后提交');
                 return;
             }
@@ -367,33 +368,39 @@ define(['app/app'], function (app) {
          * 验证邮箱是否可用
          */
         $scope.emailValid = function (email) {
+            var reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
             if (email) {
-                $http.get('basic/user/emailEnable', {
-                    params: {
-                        email: email
-                    }
-                }).success(function (data) {
-                    data = eval(data);
-                    if (data == true) {
-                        // $scope.newUserForm.newUserEmail.$setValidity('available',
-                        //     true);
-                        $scope.userEmailSuccess = true;
-                        $scope.userEmailError = false;
-                    } else {
-                        // $scope.newUserForm.newUserEmail.$setValidity('available',
-                        //     false);
-                        $scope.userEmailError = true;
-                        $scope.userEmailSuccess = false;
-                        toaster.pop('error', '错误', '邮箱 ' + email + ' 已被注册');
-                    }
-                }).error(function () {
-                    $scope.userEmailError = true;
-                    $scope.userEmailSuccess = false;
-                });
+                reg.test(email) ? $scope.userEmailSuccess = true : $scope.userEmailSuccess = false;
             } else {
-                $scope.userEmailError = false;
-                $scope.userEmailSuccess = false;
+                $scope.userEmailSuccess = true;
             }
+            // if (email) {
+            //     $http.get('basic/user/emailEnable', {
+            //         params: {
+            //             email: email
+            //         }
+            //     }).success(function (data) {
+            //         data = eval(data);
+            //         if (data == true) {
+            //             // $scope.newUserForm.newUserEmail.$setValidity('available',
+            //             //     true);
+            //             $scope.userEmailSuccess = true;
+            //             $scope.userEmailError = false;
+            //         } else {
+            //             // $scope.newUserForm.newUserEmail.$setValidity('available',
+            //             //     false);
+            //             $scope.userEmailError = true;
+            //             $scope.userEmailSuccess = false;
+            //             toaster.pop('error', '错误', '邮箱 ' + email + ' 已被注册');
+            //         }
+            //     }).error(function () {
+            //         $scope.userEmailError = true;
+            //         $scope.userEmailSuccess = false;
+            //     });
+            // } else {
+            //     $scope.userEmailError = false;
+            //     $scope.userEmailSuccess = false;
+            // }
         };
 
         /**

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

@@ -973,6 +973,7 @@
                         </td>
                         <td ng-class="{'has-error': userEmailError, 'has-success': userEmailSuccess}">
                             <input ng-model="newUser.userEmail" ng-pattern="/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/"
+                                   ng-blur="emailValid(newUser.userEmail)"
                                    name="newUserEmail" type="text"
                                    placeholder="邮箱">
                         </td>