0
我已经下载了yeoman angular fullstack,它带有登录的基本配置。登录时检查角色
的代码是这样的:
$scope.login = function(form) {
$scope.submitted = true;
if(form.$valid) {
Auth.login({
email: $scope.user.email,
password: $scope.user.password
})
.then(function() {
$scope.users = User.query();
// Logged in, redirect to home
$state.go('backend', {});
})
.catch(function(err) {
$scope.errors.other = err.message;
});
}
};
我要的是在登录过程中检查的作用和重定向他视它。我试着用这段代码,但总是返回false。
if(Auth.isAdmin()){
$state.go('backend', {});
}else{
$state.go('backend', {});
}
所以,我有一个问题:
1这是什么地方存储在用户对象在登录后的客户端?如果发生在哪里?它具有所有的性能?
哦,非常感谢,那是我的错误。固定。我采取了第二种选择,因为我认为这对长期来说更好。 – ssg