当前位置:网站首页>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
边栏推荐
- What are the accounting elements
- Is it safe to open a stock account with the QR code given by the CICC securities manager? I want to open an account
- curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection
- 360 mobile assistant is the first to access the app signature service system to help distribute privacy and security
- YOLOv6:又快又准的目標檢測框架開源啦
- Vulnhub's dc9
- 在Flutter中解析复杂的JSON
- Detailed explanation of nmap parameters
- Listing of maolaiguang discipline on the Innovation Board: it is planned to raise 400million yuan. Fanyi and fanhao brothers are the actual controllers
- 尚硅谷DolphinScheduler视频教程发布
猜你喜欢

Unity: the referenced script (unknown) on this behavior is missing“

Godson China Science and technology innovation board is listed: the market value is 35.7 billion yuan, becoming the first share of domestic CPU

Vulnhub's DC8

Leetcode (452) - detonate the balloon with the minimum number of arrows

Icml2022 | neurotoxin: a lasting back door to federal learning

Briefly describe the model animation function of unity

Word chess based on heuristic search

Module 5 operation

关于appium踩坑 :Encountered internal error running command: Error: Cannot verify the signature of (已解决)

Pass note 【 dynamic planning 】
随机推荐
Implementation of collaborative filtering evolution version neuralcf and tensorflow2
协同过滤进化版本NeuralCF及tensorflow2实现
Data governance does everything
Different subsequence problems I
Is this a bug? Whether the randomly filled letters can be closed
网络连接断开请刷新重试
同花顺注册开户有没有什么风险?安全吗?
360 mobile assistant is the first to access the app signature service system to help distribute privacy and security
AI intelligent matting tool - hair can be seen
【图像处理基础】基于matlab GUI图像曲线调整系统【含Matlab源码 1923期】
VB. Net class library (advanced version - 1)
DLA model (classification model + improved segmentation model) + deformable convolution
矩阵求导及其链式法则
亿级月活全民K歌Feed业务在腾讯云MongoDB中的应用及优化实践
Is it safe to open a stock account with the QR code given by the CICC securities manager? I want to open an account
LabVIEW Arduino tcp/ip remote smart home system (project part-5)
Word chess based on heuristic search
Leetcode (452) - detonate the balloon with the minimum number of arrows
Detailed explanation of nmap parameters
Vulnhub's DC8