Browse Source

处理个人帐户报错问题

Administrator 7 năm trước cách đây
mục cha
commit
765ca32bc6

+ 14 - 18
src/main/webapp/resources/js/sso/controllers/securitySetCtrl.js

@@ -23,10 +23,6 @@ define(['app/app'], function (app) {
             $scope.isAdmin = $rootScope.userInfo.enterprise.enAdminuu === $rootScope.userInfo.userUU ? true : false;
         }
 
-        // $scope.userInfo.pwdEnable = false;
-        // $scope.userInfo.haveUserQuestion = false;
-        // $scope.userInfo.userEmail = null;
-
         //table设置
         var applyToEnterpriseTableParams = function () {
             $scope.applyToEnterpriseTableParams = new ngTableParams({
@@ -146,20 +142,20 @@ define(['app/app'], function (app) {
 		if (typeof $scope.userInfo != 'undefined' && typeof $scope.userInfo.enterprise != 'undefined') {
 			getEnterprise();
 		} else {
-			AuthenticationService.getAuthentication().success(function (data) {
-				$scope.userInfo = data;
-				for (var i=0; i<$scope.userInfo.enterprises.length; i++) {
-					if ($scope.userInfo.enterprises[i].current) {
-						$scope.userInfo.enterprise = $scope.userInfo.enterprises[i];
-						break;
-					}
-				}
-				if ($scope.userInfo.enterprise) {
-                    getEnterprise();
-                }
-			}, function (error) {
-				toaster.pop('error', '获取用户信息失败');
-			})
+          if ($scope.userInfo.enterprise) {
+              AuthenticationService.getAuthentication().success(function (data) {
+                  $scope.userInfo = data;
+                  for (var i=0; i<$scope.userInfo.enterprises.length; i++) {
+                      if ($scope.userInfo.enterprises[i].current) {
+                          $scope.userInfo.enterprise = $scope.userInfo.enterprises[i];
+                          break;
+                      }
+                  }
+                  getEnterprise();
+              }, function (error) {
+                  toaster.pop('error', '获取用户信息失败');
+              })
+          }
 		}
 
         /**

+ 1 - 5
src/main/webapp/resources/js/sso/controllers/ssoAddressCtrl.js

@@ -14,9 +14,6 @@ define(['app/app'], function (app) {
                 $rootScope.active = 'sso_address';
                 $scope.tab = 'base';
                 $scope.userInfo = $rootScope.userInfo;
-                // $scope.userInfo.pwdEnable = false;
-                // $scope.userInfo.haveUserQuestion = false;
-                // $scope.userInfo.userEmail = null;
                 $scope.userInfoBackup = angular.copy($scope.userInfo);
                 $scope.canAddTotal = 20;
 
@@ -35,8 +32,7 @@ define(['app/app'], function (app) {
                         }, function (response) {
                             toaster.pop('error', '获取企业信息失败');
                         });
-                }
-                ;
+                };
 
                 /**
                  * 设置默认收货地址