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; });

this.api.queryCollectCart({type:1}).then(res=>{
				if(res.code===200){
					this.loveList=res.data.records
				}else{
					this.loveList = []
				}
			})优化下

原文地址: https://www.cveoy.top/t/topic/AYb 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录