async getInspectionVerifyRecordList (inspectionRecordId) {//使用async和await和resolve返回整个请求,
return new Promise((resolve, reject) => {
this.$http({
method: ‘get’,
url: ‘api/test/inspection/verify/records’,
params: {
loginAccount: this.userData.account,
tenantId: this.userData.tenantId,
inspectionRecordId: inspectionRecordId,
page: 1,
size: 1000,
order: 'oid: ’
}
}).then(async ({data}) => {
if (data.code === ‘200’ && data.type === ‘success’) {
resolve(data)
this.inspectionVerifyRecords = data.datas
let operateDate = this.inspectionVerifyRecords.pop().operateDate
// this.secondVerifyDate.push(operateDate)
return operateDate
}
})
})
},
让js执行完请求在往下执行async/await
最新推荐文章于 2023-06-15 16:05:47 发布