ENDRPrint/.svn/pristine/45/452012a3b8c13abe8120f15e9e49758b29b47554.svn-base

44 lines
1.5 KiB
Plaintext
Raw Normal View History

2024-08-14 10:33:27 +07:00
// create the controller and inject Angular's $scope
scotchApp.controller('logoutController',
// create a message to display in our view
function($scope ,$window ,$templateCache ,$location) {
//alert("logoutController");
try
{
var jsLogout = $.post(doGetPath('/logoutJsonController.json'),
{
ajax: true,
dataType: 'json',
type: "POST"
});
jsLogout.success(
function(){
$templateCache.removeAll();
//alert($window.location.href);
$window.location.href = "index.jsp";
//$location.path("/");
//$location.path("/login");
$scope.$apply();
}
).error(
function(){
$templateCache.removeAll();
$window.location.href = "index.jsp";
//$location.path("/");
//$location.path("/login");
$scope.$apply();
}
);
}
catch (e)
{
$templateCache.removeAll();
//$window.location.href = "login.jsp";
$window.location.href = "index.jsp";
//$location.path("/");
//$location.path("/login");
$scope.$apply();
//$window.location.href = "login.jsp";
}
});