The waterfall flow has requested the interface twice, how to solve it?

export function myList (obj, pageNumber, fn, url, query) {
  obj.panel.page.pageNumber = pageNumber
  let data
  if (query) {
    // 
    console.log("------------")
    data = query
  } else {
    // 
    console.log("------------")
    obj.data = {
      "page": obj.panel.page,
      "row": {
        "host_ids": obj.hostIds,
        "hostIds": obj.hostIds
      }
    }
    data = obj.data
  }
  obj.crud.loading(obj, true)
  // hostid
  if (obj.lastId !== obj.hostIds) {
    obj.panel.gridData = []
    obj.n = 1
  }
  obj.getData(obj, url, data, msg => {
    // console.log(msg)
    obj.isFirst = false
    obj.startScroll = true
    let len
    //  
    //  msg
    if (msg) {
      //totalRowtotal
      if (msg.totalRow >= 0) {
        len = msg.totalRow
      } else {
        len = msg.total
      }
      if (msg.length >= 0) {
        len = msg.length
      }
    } else {
      len = 0
    }
    // 
    obj.totalRow = len
    obj.total = len
    // 
    if (msg) {
      if (msg.size) {
        obj.data.size = msg.size
        // obj.data.size.beforeId = msg.size.beforeId
        // obj.data.size.offset = msg.size.offset
        obj.n = parseInt(msg.size.offset) / parseInt(obj.panel.page.pageSize)
      }
    } else {
      // msgundefinedreturn
      obj.crud.loading(obj, false, () => {
        obj.panel.hasData = false
        obj.reloadLock = false
      })
      return
    }

    // 
    function dataHanding (tmp) {
      // checkedfalse
      tmp.forEach(function (curr) {
        curr.checked = false
      })
      //gridData
      obj.crud.loading(obj, false, o => {
        // fn 
        if (fn) fn(msg)
        for (let entry of tmp) {
          obj.panel.gridData.push(entry)
        }
        // gridData
        obj.panel.gridData.map((val, i) => {
          val.myNum = i + 1
        })
        obj.$store.dispatch({type: "changePanelData", val: obj.panel.gridData})
        obj.nowData = obj.panel.gridData
        obj.panel.hasData = true
        if (obj.panel.gridData.length === 0) obj.panel.hasData = false
      })
    }

    // list
    if (msg.length >= 0) dataHanding(msg)
    else if (msg.list.length >= 0) dataHanding(msg.list)
    // 
    obj.lastId = obj.hostIds
  })
}
Apr.07,2021

the easiest way is to add an extra variable in front of the request interface to judge

var status=true;
if(!status)return;

getData start
status=false;


getData end
status=true;
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36ec5-2c046.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36ec5-2c046.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?