lb.services: -
"login": {
url: urlBase + "/Vendors/login",
method: "POST"
},
只有这种返回类型才能得到。 但它应该像dis: -
"登录":{
params: {
include: "user"
},
interceptor: {
response: function(response) {
var accessToken = response.data;
LoopBackAuth.setUser(accessToken.id, accessToken.userId, accessToken.user);
LoopBackAuth.rememberMe = response.config.params.rememberMe !== false;
LoopBackAuth.save();
return response.resource;
}
},
url: urlBase + "/Users/login",
method: "POST"
},
答案 0 :(得分:0)
在此处查看我在Angular上使用LoopBack的示例:https://github.com/strongloop/loopback-example-angular