当前位置:网站首页>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
边栏推荐
- 关于appium踩坑 :Encountered internal error running command: Error: Cannot verify the signature of (已解决)
- curl: (35) LibreSSL SSL_ connect: SSL_ ERROR_ SYSCALL in connection
- 股票炒股注册开户有没有什么风险?安全吗?
- 【图像处理基础】基于matlab GUI图像直方图均衡化系统【含Matlab源码 1924期】
- 买股票通过中金证券经理的开户二维码开户资金是否安全?想开户炒股
- 【混合编程jni 】第十二篇 jnaerator
- 简析攻防演练中蓝队的自查内容
- 打新债注册开户有没有什么风险?安全吗?
- Système de distribution Unity Composants en tissu (y compris les dépendances d'appel dynamique)
- 中金证券经理给的开户二维码办理股票开户安全吗?我想开个户
猜你喜欢

YOLOv6:又快又准的目標檢測框架開源啦

Web crawler 2: crawl the user ID and home page address of Netease cloud music reviews

Yolov6: un cadre de détection de cibles rapide et précis est Open Source

模块五作业

VB. Net class library to obtain the color under the mouse in the screen (Advanced - 3)

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

协同过滤进化版本NeuralCF及tensorflow2实现

Briefly describe the model animation function of unity
![Flower shop window layout [dynamic planning]](/img/d9/6b8f9cd0f74e70b313d2571c2ded30.png)
Flower shop window layout [dynamic planning]

Convolutional neural network (CNN) explanation and tensorflow2 code implementation
随机推荐
Convolutional neural network (CNN) explanation and tensorflow2 code implementation
MATLAB与Mysql数据库连接并数据交换(基于ODBC)
关于appium踩坑 :Encountered internal error running command: Error: Cannot verify the signature of (已解决)
这个算BUG吗?乱填的字母是否可以关闭
Matrix derivation and its chain rule
「连续学习Continual learning, CL」最新2022研究综述
股票炒股注册开户有没有什么风险?安全吗?
经典Wide & Deep模型介绍及tensorflow 2代码实现
leetcode:1567. Length of the longest subarray whose product is a positive number [dp[i] indicates the maximum length ending with I]
Introduction to operator
Leetcode (452) - detonate the balloon with the minimum number of arrows
如何在 SAP BTP 平台上启用 HANA Cloud 服务
JupyterLab 常用配置
Is there any risk in opening a new bond registration account? Is it safe?
Installation avec homebrew dans un environnement Mac OS [email protected]
Unity cloth system_ Cloth component (including dynamic call related)
nmap参数详解
Leetcode (122) - the best time to buy and sell stocks II
Talk about my remote work experience | community essay solicitation
Centos7 compiling and installing redis