我有一个简单的注销功能,但在本地只需1秒即可注销,而在服务器上需要6秒。如何减少注销时间。
$scope.SignOut = function() {
$rootScope.globalSession = null;
$rootScope.globalManagerViewDisplayFlag = false;
$rootScope.globalAdminViewDisplayFlag = false;
$rootScope.globalSuperViewDisplayFlag = false;
$cookieStore.remove('Session');
$cookieStore.remove('WeAlertUserData');
// $location.path('/login');
$window.location.reload();
};
});
这是我的主要索引页面。
<html lang="en" ng-app="W-Alert">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="">
<script src="libs/angular.min.js"></script>
<script src="libs/angular-route.js"></script>
<script src="libs/angular-cookies.min.js"></script>
<script src="libs/ui-bootstrap-tpls-2.0.0.min.js"></script>
<script src="libs/permission-ng.js"></script>
<script src="libs/transition/TransitionEventNames.js"></script>
<script src="libs/transition/TransitionEvents.js"></script>
<script src="libs/angular-permission.js"></script>
<script src="libs/angular-animate.min.js"></script>
<script src="libs/angular-uuid2.min.js"></script>
<!--Spinner-->
<script type="text/javascript" src="libs/spin.js"></script>
<script src="libs/angular-spinner.js"></script>
<!-- Toaster -->
<script type="text/javascript" src="libs/checklist-model.js"></script>
<link rel="stylesheet" type="text/css" href="libs/angular-toastr.css" />
<script type="text/javascript" src="libs/angular-toastr.tpls.js"></script>
<!--
<script src="js/config.js"></script> -->
<script src="js/app.js"></script>
<script src="js/controller.js"></script>
<script src="libs/dirPagination.js"></script>
<script src="js/constants.js"></script>
<!-- change password controller-->
<script src="components/change-password/change-password-controller.js"></script>
<script src="components/change-password/change-password-service.js"></script>
<!-- auth controller-->
<script src="components/authentication/authenticate-service.js"></script>
<script src="components/authentication/authenticate-controller.js"></script>
<!--client -->
<script src="components/client/client-service.js"></script>
<script src="components/client/client-controller.js"></script>
<!--manager-->
<script src="components/manager/manager-service.js"></script>
<script src="components/manager/manager-controller.js"></script>
<!--application-->
<script src="components/application/application-service.js"></script>
<script src="components/application/application-controller.js"></script>
<!--group-->
<script src="components/group/group-service.js"></script>
<script src="components/group/group-controller.js"></script>
<!--user-->
<script src="components/user/user-service.js"></script>
<script src="components/user/user-controller.js"></script>
<!--client profile-->
<script src="components/profile/profile-controller.js"></script>
<!-- Bootstrap Core CSS -->
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
<!-- DataTables CSS -->
<link href="bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="dist/css/sb-admin-2.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/w-alert.css" />
</head>
<body >
<span us-spinner="{radius:30, width:8, length: 16}" spinner-key="spinner-1"></span>
<ng-include src="'layout/shell.htm'"/>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="bower_components/metisMenu/dist/metisMenu.min.js"></script>
<!-- DataTables JavaScript -->
<script src="bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>
</body>
</html>
注意:服务器位于其他国家/地区。这有关系吗?如果有,那么我该怎么做才能减少时间?