(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 = UtilService.getCookie("regId");
        $scope.registerEmail= UtilService.getCookie("regEmail");
        $scope.flag = UtilService.getCookie("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";
            });

        }
    }
})();
