(function(){
     angular.module("app.login")
        .controller("olduserCtrl",["$scope","UtilService","$http","$interval","$location",olduserCtrl]);

    function olduserCtrl($scope,UtilService,$http,$interval,$location){
        //loading加载
        $scope.showLoading = function(){
            document.getElementById("sysLoad").style.display = "block";
        }
        $scope.hideLoading = function(){
            document.getElementById("sysLoad").style.display = "none";
        }
        //$scope.registerId = $location.search().id;
        //$scope.registerEmail= $location.search().email;
        $scope.registerId = $.cookie("regId");
        $scope.registerEmail= $.cookie("regEmail");
        $scope.flag = $.cookie("regFlag");
        $scope.hasReged = true;

        $scope.oldEmail = function(){
            $scope.showLoading();
            $http.get("api/reged/sendeactivemail/"+$scope.registerId+"/"+1).success(function(data){
                $scope.hideLoading();
                if(data.content == "success"){
                    UtilService.setCookie("ryioAcvitation",0,7);
                }else{
                    UtilService.setCookie("ryioAcvitation",1,7);
                }
                window.location.href = "activation.html";
            });
            
        }
    }
})();