JavaScript API 调用及数据处理优化 - 使用 then 和 responseHandler
const responseHandler = (res) => { if (res.code === 200) { return res.data.records; } else { return []; } };
this.api.queryCollectCart({type: 1}) .then(responseHandler) .then((loveList) => { this.loveList = loveList; });
原文地址: https://www.cveoy.top/t/topic/lPa5 著作权归作者所有。请勿转载和采集!