1.首先把接口放在数组中
let promiseValues = [getScreeningFileList(id, 'report'), getScreeningFileList(id, 'pathology')];
Promise.all(promiseValues).then((res) => {
// 掉两个接口,取数据需要注意,按照第几项取
let reportRes = res[0].data;
let pathologyRes = res[1].data;
} )
或者用以下方法
async getAfterDetail () {
try {
const res = await getAfterDetail(this.$route.query.id)
this.detail = res.data
const res2 = await getDetailById(this.detail.saleOrderId)
this.orderDetail = res2.data
} catch (error) {
console.log(error)
}
},