[英]Refreshing/reloading page after logout
I want page to be refreshed/reloaded after logout (message on screen is visible for 5 seconds). 我希望在注销后刷新/重新加载页面(屏幕上的消息可见5秒)。 Current code won't refresh it so I'm still seeing user's name in header instead of something else like Login button.
当前代码不会刷新它,所以我仍然在标题中看到用户的名字,而不是像登录按钮那样的东西。
.controller('logout', ['$scope', 'location', 'config', 'auth', '$timeout', '$route', function($scope, location, config, auth, $timeout, $route) {
auth.isValid($scope, function() {
auth.logout(function() {
$timeout(function() {
location.path('/login');
$route.reload();
}, 5000);
});
});
}])
You can use JavaScript location for this. 您可以使用JavaScript位置。
location.reload(); location.reload();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.