In the angularjs project, some functions require logging in to access. Now I can only control whether the user is logged in when clicking on the navigation. If the user is accessed directly using a link, I cannot determine whether the user is logged in. Here’s my method
$scope.login = function(){
$scope.unlogin = false;
//登录操作
}
$scope.login = function(){
$scope.unlogin = true;
//退出操作
}
<a ng-if="unlogin" ui-sref="login">我的收藏</a>
<a ng-if="!unlogin" ui-sref="myData">我的收藏</a>
To achieve this, users can check whether they are logged in by directly accessing the link. What should be done?