How does JS solve the asynchronous problem?

in the if else statement, I have asynchronous requests. I set the interceptor after getting the data of the asynchronous request. My idea is that there is no way to set the interceptor after the if else is finished. My current idea is to use ES7 async await, but Mini Program does not support it at present. Another way is to add then, in the if else, but you have to write the interceptor twice. Do you have a better solution?
Mar.16,2021

encapsulate the above two asynchronous requests with a promise , and then set the interceptor in the then of this promise :

new Promise((resolve, reject) => {
  if (!res.authSetting...) {
    fly.get('/init.ujson').then(res => {
      ...
    }).then(resolve)
  } else {
    wx.getUserInfo({
      ...
    }).then(resolve)
  }
}).then(res => {
  fly.interceptors...
})
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-1b3b608-412cd.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-1b3b608-412cd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?