如何使用角度js获得不同的会话

时间:2015-11-26 07:50:47

标签: javascript angularjs session

我正在使用angular JS构建应用程序。获得当前会话时我遇到了问题  这是我的控制器

angular.module('ssoController',[])
.controller('LoginController',['dataProvider', '$rootScope','$scope','$q','$location', '$log', '$timeout', 'authService', 'GLOBAL_EVENTS', 'toast', 'STORE_CONFIG', 'ssoAuth', '$state',
    function(dataProvider, $rootScope, $scope, $q, $location, $log, $timeout, authService, GLOBAL_EVENTS, toast, STORE_CONFIG, ssoAuth, $state){

    this.ssoGoogle = function(){
        // intiate
        ssoAuth.google.initiate()
        .then(function(customer) {
            authService.setCurrentSession(customer, $scope);
            $state.go('products', {}, {reload: true});
        })
        .catch(function(error) {
            toast.create({content:error, className:'error'});
        });
    };

}]);

这是我的示例数据json

{
  account: {
    email: "anonymous@gmail.com",
    firstName: "Anonymous",
    lastName: "Anonymous",
    store: "564f1504122417354ff38b00",
    createdAt: "2015-11-26T04:46:28.465Z",
    updatedAt: "2015-11-26T04:46:28.465Z",
    id: "56568ea4306962401f94ad75"
  },
  email: "anonymous@gmail.com",
  createdAt: "2015-11-26T04:46:28.584Z",
  updatedAt: "2015-11-26T04:46:28.592Z",
  id: "56568ea4306962401f94ad76"
}

我不知道为什么会话总是呼叫ID帐户( 56568ea4306962401f94ad75 )并且不会呼叫ID 56568ea4306962401f94ad76 。我设置的会话ID有什么问题?

0 个答案:

没有答案