ENDRPrint_12CRelease/web/js/ctrl/logoutController.js

55 lines
1.9 KiB
JavaScript
Raw Normal View History

2024-08-14 10:58:03 +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 {
$.post(doGetPath('/logoutJsonController.json'),
{
ajax: true,
dataType: 'json',
type: "POST"
});
$templateCache.removeAll();
$location.url('login').replace();
// $window.location.href = "";
$scope.$apply();
// 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";
}
});