A question about async/await asynchronous requests?

inside the asyncData method of the nuxt.js framework

 let [
        FindInstitutionsDetailed,
        EnterpriseHot,
    ]
    = await Promise.all([
                P.FindInstitutionsDetailed({"id":context.route.query.id+""}),
                P.EnterpriseHot()
            ])
            return {
                ***FindInstitutionsDetailed***: FindInstitutionsDetailed.data,
                EnterpriseHot: EnterpriseHot.data,
            }

as shown in the figure above, it is always written like this. Promise.all requests all APIs concurrently before the page is rendered. There"s no problem with that.

however, there is now an interface that needs to get userId as a parameter from the FindInstitutionsDetailed interface.

would you like to ask how to write it? You cannot access this in nuxt.
or after Promise.all (...) . Then ?



async function f(){
    var result = await new Promise(function(resolve){
        setTimeout(function(){
            resolve('hello')
        })
    })
    await new Promise(function(resolve){
        resolve(result+' world')
    }).then(console.log);
}
f()
Menu