antd pro2.0 使用記錄三:多個接口調用問題

當多個接口調用,後面的接口須要使用前面接口返回的數據時,咱們須要用到 .then()的寫法,以下:html

let _this = this;
//接口10,獲取數據分組
dispatch({
   type: 'resourceMonitor/queryHistoryTopMetricsGroup',
   payload: '49',
}).then(function() {     //接口4,獲得級聯框中的全部數據
   dispatch({
      type: 'resourceMonitor/queryVisibleScope',
      payload: {
        customIdList,
        projectIdList,
        sysInstanceIdList,
      },
    }).then(function() {
       //接口5,獲取運行狀況排名的各列的顏色配置信息
      dispatch({
        type: 'resourceMonitor/querySaleDayStatsMetricsDefine',
        payload: '49',
      });
      //接口9:獲取運行狀況每一個表格對應的數據
      _this.getTopAndBottomData(dispatch, _this.state.salesType, _this.props);
    });
});

 

上篇:antd pro2.0 記錄二:登陸/註冊頁面邏輯,調用後臺antd

下篇:antd pro2.0 使用記錄四:右側頂部菜單欄+新建頁面post

相關文章
相關標籤/搜索