{errMsg: "getUserInfo:ok", rawData: "{"nickName":"We1.","gender":1,"language":"zh_CN","…guItElHFicHRIOxsPXGG1QYIbr6JaBtgfevMEiczXVQ/132"}", userInfo: {…}, signature: "1d1fe7f5588399a9aca0a6dbb9941540701e68f4", encryptedData: "VQfGahUPnAfw1S5X7IqL51WHQaneuO78WaxDN3MMonyTI3kDQV…50gNguUzSHhmt/saaVabDwj9+yal1BNmkNJraFiGadjtjsV4c", …}encryptedData: "VQfGahUPnAfw1S5X7IqL51WHQaneuO78WaxDN3MMonyTI3kDQVMPp7L4T+1kFHdZTDv0kUejLcA7zyHd6tNF+ECoifcYvRKPSll2xU7jTWHm5HxePpNo2A1TdIL4FWGFOI52btjr9RnL0pvEPUv4Ty/JcwvSFmrwUZCNCUAfa5GDX3nJK51hJO8Fhlqdl1rndak3lLhf8gsnFvM0aALRtKb883M4k3SqjOEbeNWYd+1BG9jZ5kzhXhL0GSj1DB7LzLDgftQFqo2QKvC38kxF+luEDJ0QBWy7MC29Qp8vujZV4uzjhyFDdIamFsPxyc9ReaV2H2hNDJwknPXVamwALHKi5IhLXy6Fglj9pRuLzR0zS9FLjSDJAuxf/QCxYvnNLGD80rHh4Eew+lmdDLdI7w6PwkaxGol3Q12Jt1DSPOHMUAH7T1YA6/8IDYFhjLnONOyfm0DBOddQXtz50gNguUzSHhmt/saaVabDwj9+yal1BNmkNJraFiGadjtjsV4c"errMsg: "getUserInfo:ok"iv: "0ve/BCw0smvjp5AvqPGPqg=="rawData: "{"nickName":"We1.","gender":1,"language":"zh_CN","city":"Mudanjiang","province":"Heilongjiang","country":"China","avatarUrl":"https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eqiahgLmCiapFLIp3U0137iaicEwmAVyvBmVvkib6guItElHFicHRIOxsPXGG1QYIbr6JaBtgfevMEiczXVQ/132"}"signature: "1d1fe7f5588399a9aca0a6dbb9941540701e68f4"userInfo: {nickName: "We1.", gender: 1, language: "zh_CN", city: "Mudanjiang", province: "Heilongjiang", …}__proto__: Object
如果你原来用getUserInfo获取openid且同时保存用户信息的,建议你改用auth.code2Session和getUserProfile,不然会出现两个弹窗体验不好。如果只是用于获取用户信息的就直接改用getUserProfile,用getUserProfile时在bindtap调用的方法里面调用接口即可
怎么救?
https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801?blockType=1
<image wx:if='{{userInfo.avatarUrl}}' class="avatarUrl" src="{{userInfo.avatarUrl}}"></image>
<button wx:else bindgetuserinfo='handleGetUserInfo' open-type="getUserInfo">获取用户信息</button>
<text class="userName">{{userInfo.nickName}}</text>
<!-- 测试事件绑定 -->
<!-- <view class="goStudy" catchtap="handleParent">
<text catchtap='handleChild'>hello world</text>
</view> -->
<view class="goStudy" catchtap="toLogs">
<text >hello world</text>
</view>
</view>
额。。。所以你想问什么问题
<image wx:if='{{userInfo.avatarUrl}}' class="avatarUrl" src="{{userInfo.avatarUrl}}"></image>
<button wx:else bindgetuserinfo='handleGetUserInfo' open-type="getUserProfile">获取用户信息</button>
<text class="userName">{{userInfo.nickName}}</text>
<!-- 测试事件绑定 -->
<!-- <view class="goStudy" catchtap="handleParent">
<text catchtap='handleChild'>hello world</text>
</view> -->
<view class="goStudy" catchtap="toLogs">
<text >hello world</text>
</view>