【发布时间】:2019-10-04 04:06:58
【问题描述】:
这是我从 node.js 获得的 json 对象
{count: 2, users: Array(2)}
count: 2
users: Array(2)
0: {_id: "5cdd1c260d0b3d0660d85bfc", name: "Punith", email: "puntihdd@gmail.com", request: {…}}
1: {_id: "5cdd1c4d0d0b3d0660d85bfd", name: "Ashwith", email: "ashwith@gmail.com", request: {…}}
length: 2
__proto__: Array(0)
__proto__: Object
我想得到
[
{
_id: ,
name: ,
email: ,
}
]
按此顺序
【问题讨论】:
-
你能显示代码吗?
-
您目前如何访问它?
-
export const logIn = (email, password) => { console.log('loggin in'); const res = fetch(LOGIN_URL, { method: "POST", headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ email: email, password: password }) }).then(res => res.json()) .catch(err => err); return res; } -
您介意把它放在问题的正文中吗?注释不是代码示例的好地方,因为它会丢弃大多数格式...
标签: javascript reactjs http native