async/await语法
这是ES7的语法,它是基于generator函数做的语法(常用)
async function 函数名(){
let obj = await getName()
return obj
}
函数名().then(res=>{
//得到函数的返回值
})