我正在扩展JSONSerializer
以适应我的服务器响应,如下所示:
{
"result": {
"items": [
{
"id": "...",
"title": "...",
...
},
...
],
"total": number,
"...": "..."
}
}
因此我覆盖了normalizeResponse()
方法:
normalizeResponse: function(store, primaryModelClass, payload, id, requestType) {
payload = payload.result.items;
return this._super(store, primaryModelClass, payload, id, requestType)
},
之后,我的模型数据字段全部为undefined
。我做错了什么?