How does vue recursively judge the request interface response data for a second after making a decision?

can"t do it with setInterval. Is there any other way

const payState = setInterval(() => {
  _this.$api["payment/payState"]({
    PayNo: _this.orderNo,
  }).then((results) => {
    (results.Success === true)
      && clearInterval(payState)
      && (_this.paymentPopup = true);
  }).catch((err) => {
    console.error(err);
  });
  console.log("result", result);
}, 1000);
May.13,2022

try this

let payState  
_this.$api['payment/payState']({
    PayNo: _this.orderNo,
  }).then((results) => {
    payState = setTimeout(() => {
      if (true) {
        // do something
        clearTimeout(payState)
      }
    }, 1000)
  }).catch((err) => {
    console.error(err);
  });
  console.log('result', result);
}

const payState = () => {
    return new Promise((resolve, reject)=>{
        // setTimeoutresolve
        setTimeout(()=>{
          resolve()
        }, 1000)
      })
}
await payState()
console.log('1s')
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-1b40be7-40ac5.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-1b40be7-40ac5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?