Promise about solving the problem of ajax nesting

function getPromise(url, method = "GET", data = {}, header = {}) {
    return new Promise((resolve, reject) => {
        wx.request({
            url: url,
            header: header,
            success: function (res) {
                resolve(res)
            },
            fail: function (res) {
                reject(res)
            },
            method: method,
            data: data,
            dataType: "json"
        })
    })
}

is encapsulated as above;
is called as follows

getPromise(_url, "POST", _data)
        .then((res) => {

        })

is called as above, but what if multiple requests are nested within each other?

getPromise(_url, "POST", _data)
        .then((res) => {
            getPromise(_url, "POST", _data)
                .then((res) => {
                               ...
                })
        })
Mar.28,2021

multiple requests to return the Promise object

  

async is used with await

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-1e4bd1d-59eb3.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-1e4bd1d-59eb3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?