2
我已經試過這一點,但它似乎並沒有被工作我缺少什麼當您使用restangular時,您當前如何登錄用戶對象?
Restangular.one('authenticated_user').get().then(function(response){
return response;
}, function(response){
return response;
});
我已經試過這一點,但它似乎並沒有被工作我缺少什麼當您使用restangular時,您當前如何登錄用戶對象?
Restangular.one('authenticated_user').get().then(function(response){
return response;
}, function(response){
return response;
});
我想通了!
function getAuthenticatedUser(onSuccess, onError){
Restangular.one('authenticated_user').get().then(function(response){
onSuccess(response.user);
}, function(response){
onError(response);
});
}
我的意思是一個包含當前登錄用戶信息的對象。現在希望它更清楚。 –