当前位置:网站首页>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
边栏推荐
- Kdd2022 𞓜 unified session recommendation system based on knowledge enhancement prompt learning
- Data governance does everything
- Godson China Science and technology innovation board is listed: the market value is 35.7 billion yuan, becoming the first share of domestic CPU
- How to analyze financial expenses
- 亿级月活全民K歌Feed业务在腾讯云MongoDB中的应用及优化实践
- leetcode:1567. Length of the longest subarray whose product is a positive number [dp[i] indicates the maximum length ending with I]
- 模块五作业
- 如何在 SAP BTP 平台上启用 HANA Cloud 服务
- 在Flutter中解析复杂的JSON
- 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,
猜你喜欢

vulnhub之dc8

ICML2022 | Neurotoxin:联邦学习的持久后门

VB. Net class library - 4 screen shots, clipping
![[solution] sword finger offer 15 Number of 1 in binary (C language)](/img/ab/149775ae8ed94464efdf6921c1022a.png)
[solution] sword finger offer 15 Number of 1 in binary (C language)

VB. Net class library (Advanced - 2 overload)

Convolutional neural network (CNN) explanation and tensorflow2 code implementation

leetcode:710. 黑名单中的随机数【映射思维】
![leetcode:141. Circular linked list [hash table + speed pointer]](/img/19/f918f2cff9f831d4bbc411fe1b9776.png)
leetcode:141. Circular linked list [hash table + speed pointer]

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

Parsing complex JSON in fluent
随机推荐
KDD2022 | 基于知识增强提示学习的统一会话推荐系统
SAP Spartacus 中的依赖注入 Dependency Injection 介绍
Leetcode (452) - detonate the balloon with the minimum number of arrows
How SAP Spartacus default routing configuration works
DAST black box vulnerability scanner part 5: vulnerability scanning engine and service capability
leetcode:6103. Delete the minimum score of the edge from the tree [DFS + connected component + value record of the subgraph]
模块五作业
经典Wide & Deep模型介绍及tensorflow 2代码实现
Final part of web crawler: send directional messages to 100000 Netease cloud users
YOLOv6:又快又准的目标检测框架开源啦
Is there any risk in opening a securities registration account? Is it safe?
网络爬虫2:抓取网易云音乐评论用户ID及主页地址
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研究综述
Icml2022 | neurotoxin: a lasting back door to federal learning
Convolutional neural network (CNN) explanation and tensorflow2 code implementation
[mathematical modeling] spanning tree based on Matlab GUI random nodes [including Matlab source code 1919]
股票炒股注册开户有没有什么风险?安全吗?
Unity animation knowledge of Art
【图像处理基础】基于matlab GUI图像曲线调整系统【含Matlab源码 1923期】