获得徽章 3
- #1024一起掘金# 如何返回字符串?
原函数:
function geUrl() {
const userInfo = wx.getStorageSync('userInfo')||{};
return userInfo.isOwner
}
变化:
现在userInfo 无法从getStorageSync中取出,需要从接口中获取;
改造:
async function geUrl() {
const userInfo = await getData();
return userInfo.isOwner
}
问题,我如何直接获取 userInfo.isOwner 而不是 promise?展开65
![[看]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_97.39cdc9f.png)
![[灵光一现]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_25.51e6984.png)
![[捂脸]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_28.8981538.png)