当前位置:网站首页>Wechat applet adds data to the database
Wechat applet adds data to the database
2022-04-22 13:23:00 【CSDN Q & A】
This is a getUserProfile The code for the event
```javascriptgetUserProfile(e) { wx.getUserProfile({ desc: ' Get your nickname 、 Head portrait 、 Region and gender ', // Declare the purpose of obtaining the user's personal information , The follow-up will be shown in the pop-up window , Please fill in carefully success: (res) => { // console.log(res); this.setData({ userInfo: res.userInfo, hasUserInfo: true, }) }, })
Here is to add the obtained data to the database , But if you write like this ,userInfo I can't seem to get it
```javascriptlet userInfo=this.userInfo; if(!this.data.hasUserInfo && userInfo){ db.collection('users').add({ data:{ userPic:userInfo.avatarUrl, nickname:userInfo.nickName,
This is a getUserProfile The printed value , In this case, I want to get userInfo How to write the path , I write like this (let userInfo=this.userInfo;) It's wrong.

版权声明
本文为[CSDN Q & A]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204152220327766.html
边栏推荐
- Operating revenue data set of listed companies (the third quarter of 1990-2021)
- 互联网巨头的广告攻守战
- “开源之夏”活动火热报名中,丰厚奖金等你来拿
- Compressed backup of raspberry pie
- Advertising offensive and defensive war of Internet giants
- mysql数据库已经成功启动,可是show不是内部或外部命令,该如何解决呢?
- What happens when the weight of the model and loss or intermediate variable become Nan
- 深度学习论文阅读目标检测篇(二):Fast R-CNN《Fast R-CNN》
- ROS机器人学习——TF坐标变换
- mysql FUNCTION xxx. CHARINDEX does not exist
猜你喜欢

Inamori Kazuo: face the reality, think hard and fight head-on
![[dark horse morning post] it is known that it is listed in Hong Kong today; Xiaohongshu responded to layoffs of 20%; The glory of the king was accused of plagiarism; Liu Jianhong's live broadcasting r](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[dark horse morning post] it is known that it is listed in Hong Kong today; Xiaohongshu responded to layoffs of 20%; The glory of the king was accused of plagiarism; Liu Jianhong's live broadcasting r

ROS机器人学习——麦克纳姆轮运动学解算

How does MySQL sort by default when using the select statement without order by?

【黑马早报】知乎今日在港上市;小红书回应裁员20%;王者荣耀被指控抄袭;刘畊宏直播收入10天涨10倍;“知网反垄断第一案”已立案...

ROS2——参数的使用

销量大腰斩,岚图无蓝图

Oplg: new generation cloud primary observable best practices

Measurement and driving factors of China's digital economy - informatization degree measurement index (2013-2020)

Panel data of provincial innovation capacity - including multi index data such as number of patents and turnover (2008-2019)
随机推荐
算法---设计推特(Kotlin)
Graph search of obstacles in far planner
Chrome多设备书签同步方案
linux下redis6.详细安装
Stc8h internal eepom explanation
PM4PY - 分析建议怎样的BPMN可以转换成Process Tree
Redis update
FreeRTOS快速入门-初探FreeRTOS
[introduction to keras] MNIST dataset classification
HDU 2680 shortest path Dijkstra + chained forward star + priority queue (template)
STM32CubeMX重定向printf输出至串口
Number of redis configuration databases
Node debugging guide - inspector protocol
“开源之夏”活动火热报名中,丰厚奖金等你来拿
小程序分享给好友列表以及分享到朋友圈
分享下最近遇到的5种网站变慢的案例
Panel data of green total factor productivity of gtfp in all provinces (2004-2018)
上市公司营业收入数据集(1990-2021第三季度)
Partition - elegant violence
How to become an open source database developer?