Browse Source

解决我店铺401的问题

shenjj@usoftchina.com 8 years ago
parent
commit
edf4d79d59
1 changed files with 11 additions and 11 deletions
  1. 11 11
      src/main/webapp/resources/js/common/controllers/commonCtrls.js

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

@@ -962,18 +962,18 @@ define([ 'app/app' ], function(app) {
 	}]);
 
 	// 我的店铺侧边栏的Controller
-  app.controller('goCartCtrl', ['$scope', 'StoreInfo', function($scope, StoreInfo) {
-    $scope.uuid = false
-		console.log(111)
-    StoreInfo.existStore({}, {}, function (result) {
-    	$scope.uuid = result.uuid
-			console.log($scope.uuid)
-		})
-    $scope.openMystore = function(){
-    	var uuid = $scope.uuid
-      window.open('store/' + uuid, '_self');
+	app.controller('goCartCtrl', ['$scope', 'StoreInfo', 'AuthenticationService', function($scope, StoreInfo, AuthenticationService) {
+		$scope.uuid = false;
+    if(AuthenticationService.isAuthed()) {
+      StoreInfo.existStore({}, {}, function (result) {
+        $scope.uuid = result.uuid;
+      })
+    }
+		$scope.openMystore = function(){
+			var uuid = $scope.uuid;
+			window.open('store/' + uuid, '_self');
 		}
-  }])
+	}])
 
 
 	// Web Chat侧边栏的Controller