SOURCE

console 命令行工具 X clear

                    
>
console
// async randomRequest ()  {
//     await this.sleep(1000)
//     return new  Promise((resolve, reject) => {
//       let random = Math.random() * 10
//       if (random < 6) resolve('审理中')
//       if (random < 8 && random >= 6) resolve('成功')
//       if (random < 10 && random >= 8) reject('失败')
//     })
//   }
//   async loop () {
//     let count = 5
//     let isNext = true
//     while (count > 0 && isNext) {
//       isNext = false
//       try{
//         let res = await this.randomRequest()
//         if(res === '审理中') isNext = true
//         console.log(res)
//       }catch(err){
//         console.log(err)
//         isNext = false
//       }
//       await this.sleep(5000)
//       count --
//     }
//   }
//   sleep (time) {
//     return new Promise((resolve) => setTimeout(resolve, time))
//   }

// this.loop()
<h1>
    轮询请求 支付结果
</h1>