求问wx.getUserInfo 切换到 wx.getUserProfile代码怎么改?
// pages/login/login.js Page({ data:{ userinfo:{}, openid:"" }, onGotUserInfo:function(e){ const that =this wx.cloud.callFunction({ name:"login", success:res=>{ console.log("云函数调用成功") that.setData({ openid:res.result.openid, userinfo:e.detail.userInfo }) that.data.userinfo.openid = that.data.openid console.log("userinfo",that.data.userinfo) wx.setStorageSync('userinfo', that.data.userinfo) }, fail:res=>{ console.log("云函数调用失败") } }) this.setData({ userinfo:e.detail.userInfo }) console.log("userinfo",this.data.userinfo) }, onLoad:function(options){ const ui = wx.getStorageInfoSync('userinfo') this.setData({ userinfo:ui, openid:ui.openid }) } })