我有下面的代码片段,这给了我一个错误。我从长度为 1 的 getFilteredList 得到响应,并且它具有正确的 json 数据。但不知道为什么它给出错误。
TypeError:无法读取 null 的属性“then”
getFilteredList(group, feature).then(r=>{ //here I am getting error.
if(r.data.response_code == "1")
{
const columnName = "ColumnName";
const Codes = r.data.response_message.map(x => x[columnName]);
Codes.forEach(code=> {
let store = getStoreValue(code);
getDetailsById(id, datastore)
.then(r=>{
res.status(200).send(r.data);
}).catch(e=>{
parseError(e, res);
});
})
}
}).catch(e=>{
parseError(e, res);
});
}
有人可以帮忙吗。
getFilteredList() 是另一个节点 js 服务,它本身返回 json 数据,我可以在日志中看到该数据。下面是它返回的数据。
{"CODE":"AGR","GRP":"LEND","FEAT_CODE":"SRC_AGREE","GROUP_NAME":"Prop","FEA_NAME":"Property","DISPLAY_NAME":"Property"," ROLE_CODE":"LE"}
谢谢。