请问getuserprofile怎么写入云数据库?

小程序 文章 2021-03-20 12:41 0 34 全屏看文

请问getuserprofile怎么写入云数据库?How does getuserprofile write into the cloud database?

请问getuserprofile怎么写入云数据库?
这是我以前用js写的插入云数据库的代码,求问大家应该怎么修改?  bindGetUserInfo(ev);{    //console.log(ev);    let userInfo =ev.detail.userInfo;    if(!this.data.logged && userInfo){//后面是对的,前面不知道      db.collection('user').add({        data: {          userPhoto:userInfo.avatarUrl,          nickName: userInfo.nickName,          signature:'',          phoneNumber:'',          weixinNumber:'',          links:0,          time:new Data()        }      }).then((res)=>{        console.log(res);        });    }    }

This is the code I used to write in JS to insert into the cloud database. How should you modify it?   bindGetUserInfo(ev);{    // console.log (ev);    let userInfo = ev.detail.userInfo ;    if(! this.data.logged & & userinfo) {/ / the following is right, but I don't know the front db.collection ('user').add({        data: {           userPhoto:userInfo.avatarUrl ,          nickName:  userInfo.nickName ,           signature:'',          phoneNumber:'',          weixinNumber:'',           links:0 ,           time:new  Data()        }      }).then((res)=>{         console.log (res);        });    }    }

回答:

陈宇明:

添加的方式是一样的,主要是获取用户的信息。

具体可见:https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801

炸鸡:能否上一段 wxml button组件的代码🙏
😺 😄 ?%🐮 😊 😄:

看着头疼,openid呢?

炸鸡:

感谢各位!!!

-EOF-