在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ 關于 Promise.all 的問題

關于 Promise.all 的問題

async index() {
    const ctx = this.ctx;
    // 所有異步接口執(zhí)行
    const infoRes  = await Promise.all([
      ctx.service.agilent.index.isUserInfoChecked(), // 0 資料是否提交過檢驗
      ctx.service.agilent.index.getFormInfo(), // 1 獲取表單信息
      ctx.service.agilent.index.download(), // 2 附件資料下載
      ctx.service.agilent.index.videoList(), // 3 視頻信息獲取
      ctx.service.agilent.index.publicList(), // 4 出版物快報信息獲取
      ctx.service.agilent.index.seminarList() // 5 網(wǎng)絡研討會信息獲取
    ])
 }
  • 有一個問題,上面的接口獲取是通過 infoRes[下標] 獲取的
  • 現(xiàn)在我想使用 infoRes.xxx 去獲取 接口
  • 怎么搞?
回答
編輯回答
呆萌傻

Promise.all返回數(shù)組自己把他轉(zhuǎn)換成對象啊

2017年8月8日 18:47