当我输入console.log(响应)时,会出现:
但是当我在网络预览中访问请求时,响应如下:
型号:
export class UserId {
id: number
user: string
name: string
email: string
photo: string
last_login: string
password: string
status: number
is_admin: number
dt_created: string
}
服务:
getUserById(id: number) {
return this.service.getUserById(`${this.endpointGetUserId}/${id}`)
.map((response) => {
return response.user;
});
}
Http:
getUserById(path: string) {
return this.http.get<UserId>(this.baseUrl + path);
}