{
"code": 200,
"msg": "success",
"data": {
"total": 2,
"page": 1,
"size": 20000,
"list": [
{
"uid": 60000,
"account": "60000",
"name": "AB",
"rank": 1,
"avatar": "123.jpg",
"phone": "1111111110",
"created": "2019-02-19T17:15:49+08:00",
"updated": "2019-04-28T14:43:25+08:00"
},
{
"uid": 60009,
"account": "60009",
"name": "CD",
"rank": 2,
"avatar": "",
"phone": "155555555554",
"created": "2019-02-26T10:42:44+08:00",
"updated": "2019-04-28T16:13:18+08:00"
}
]
}
}
es6解构
let {
code,
msg,
data: { total, list },
} = result.data;
//输出
console.log(code) //200
console.log(msg)//success
console.log(total)//2
console.log(data)//Uncaught (in promise) ReferenceError: data is not defined
console.log(list)//list数组