当前位置:网站首页>Wechat applet is authorized to log in wx getUserProfile
Wechat applet is authorized to log in wx getUserProfile
2022-06-26 22:04:00 【Procedures for trying to move bricks】
1. Adjust the interface of authorized login to obtain user information , I added a new one wx.getUserProfile. Special notes on authorized login :
2. The original authorized login process remains unchanged , Is still wx.login >>> code >>> Request interface openid >>> openid >>> Custom request status >>> uid
Just the place to get user information has changed , To obtain user information, you must go through wx.getUserProfile obtain
3.wx.getUserProfile This API It must be written at the top of the event , Only events can trigger
<button bindtap="login"> land </button>
login() {
wx.getUserProfile({
desc: ' Display user information ', // 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: (file) => {
console.log(file)
wx.login({
success: (res) => {
console.log(res);
wx.request({
url: 'code obtain openid The interface of ',
data: {
code: res.code
},
success: (open) => {
console.log(open.data);
wx.request({
url: ' Authorized login interface ',
data: {
openid: open.data.openid,
NickName: file.userInfo.nickName,
HeadUrl: file.userInfo.avatarUrl
},
success(data) {
console.log(data.data);
}
})
}
})
}
})
}
})
},
Get the interface change history of user information :
Direct use wx.getUserInfo Get user information , Later restricted .
Use button Button on the open-type="getUserInfo", adopt bindgetuserinfo Event to get user information , Now limit .
Use API:wx.getUserProFile Get user information
边栏推荐
- 打新债注册开户有没有什么风险?安全吗?
- VB. Net class library (advanced version - 1)
- Test comparison of linear model LN, single neural network SNN, deep neural network DNN and CNN
- SAP Spartacus 默认路由配置的工作原理
- 【混合编程jni 】第十一篇之JNA详情
- CVPR 2022 | 美团技术团队精选论文解读
- 请问CMS里UniAPP版本中的&ldquo;自定义表单列表如何去掉?
- [fundamentals of image processing] GUI image curve adjustment system based on MATLAB [including Matlab source code 1923]
- Release of dolphin scheduler video tutorial in Shangsi Valley
- Shiniman household sprint A shares: annual revenue of nearly 1.2 billion red star Macalline and incredibly home are shareholders
猜你喜欢

Some ways out for older programmers

Parsing complex JSON in fluent
![[fundamentals of image processing] GUI image curve adjustment system based on MATLAB [including Matlab source code 1923]](/img/e8/6342f2dc6e7f06a847852ce4b40719.jpg)
[fundamentals of image processing] GUI image curve adjustment system based on MATLAB [including Matlab source code 1923]

Application and Optimization Practice of 100 million level monthly live national karaoke feed service in Tencent cloud mongodb

Word chess based on heuristic search

360 mobile assistant is the first to access the app signature service system to help distribute privacy and security

leetcode:710. 黑名单中的随机数【映射思维】

亿级月活全民K歌Feed业务在腾讯云MongoDB中的应用及优化实践
![[mathematical modeling] spanning tree based on Matlab GUI random nodes [including Matlab source code 1919]](/img/0c/17efaaa2488451b6dd15d9db33eba7.jpg)
[mathematical modeling] spanning tree based on Matlab GUI random nodes [including Matlab source code 1919]

Matrix derivation and its chain rule
随机推荐
【混合编程jni 】第九篇之Jni总结
【混合编程jni 】第十二篇 jnaerator
Comprehensive evaluation of online collaboration documents: note, flowus, WOLAI, Feishu, YuQue, Microsoft office, Google Docs, Jinshan docs, Tencent docs, graphite docs, Dropbox paper, nutcloud docs,
Yolov6: un cadre de détection de cibles rapide et précis est Open Source
Is this a bug? Whether the randomly filled letters can be closed
如何写好测试用例以及go单元测试工具testify简单介绍
Application and Optimization Practice of 100 million level monthly live national karaoke feed service in Tencent cloud mongodb
Parsing complex JSON in fluent
curl: (35) LibreSSL SSL_ connect: SSL_ ERROR_ SYSCALL in connection
Talk about my remote work experience | community essay solicitation
Unity3D插件 AnyPortrait 2D骨骼動畫制作
The sharp sword of API management -- eolink
DLA model (classification model + improved segmentation model) + deformable convolution
YOLOv6:又快又准的目标检测框架开源啦
Is it safe to open a stock account with the QR code given by the CICC securities manager? I want to open an account
「连续学习Continual learning, CL」最新2022研究综述
Flower shop window layout [dynamic planning]
Introduction to dependency injection in SAP Spartacus
Unity: the referenced script (unknown) on this behavior is missing“
nmap参数详解