Async和Await的用法

for(let i=0; i <that.openIds.length;i++){

                    let openId = that.openIds[i];
                    let res = await that.getUserInfo(openId);
                    let userName = res.data.data.userName;
                    let nickName =  res.data.data.nickName;
                    await that.initRoom(openId,userName);
                    console.log("初始化ROOM结束,join用户id",window.Evp.User.info.id);
                    await this.updateUser(openId,userName)
                    console.info("更新用户信息成功:{},{},{}", window.Evp.User.info.id, window.Evp.User.info.third_party_id, window.Evp.User.info.nickname)
                    await that.joinLottery();

                    console.log("=========================================================================================")
                }
原文地址:https://www.cnblogs.com/houchen/p/14710653.html