0
我正在使用nodejs loopback應用程序。我有一個用戶已經登錄,並且一項操作要求此用戶找到userById
並更新一個字段。登錄後不能更新另一個用戶的詳細信息
$scope.user = User.findById({
id: sender.id
});
$scope.user.supplierId = currUserId;
$scope.user.$save();
但它沒有按要求工作。
,我得到以下錯誤:
PUT http://localhost:5000/api/users 401 (Unauthorized)
GET http://localhost:5000/api/AuthProviders/count 401 (Unauthorized)
401 while on router on login path
POST http://localhost:5000/api/users/login?include=user 400 (Bad Request)
任何幫助將不勝感激。 感謝
你使用他們提供的angularjs或angular sdk嗎? –
我正在使用AngularJS – georgian98
您不能使用模型來訪問具有常規angularjs代碼的休息終端。不過,您可以使用角度http訪問它們。我會發布答案。 –