Recently, WeChat Mini Program has proposed adjustments to the wx.login and wx.getUserInfo interfaces for the audit mini program, and proposed a new interface for developers to call The following figure is the official document details for the new interface Click to visit the official website for more details It is worth noting that the new interface wx.getUserProfile can only be called using catchtap or bindtap (ps: it can be used in wx.showmodel), and cannot be called directly in onload, onshow, etc., and the return parameters have changed. The following figure shows the data type returned by the new interface wx.getUserProfile // An highlighted block wx.showModal({ title: 'Warm Tips', content: 'Requesting your personal information', success(res) { if (res.confirm) { wx.getUserProfile({ desc: "Get your nickname, avatar, region and gender", success: res => { console.log(res) let wxUserInfo = res.userInfo; }, fail: res => { //Reject authorization that.showErrorModal('You rejected the request'); return; } })} else if (res.cancel) { //Reject authorization showErrorModal is a custom prompt that.showErrorModal('You rejected the request'); return; } } }) The new version of wx.login interface returns. The interface return of wx.getUserInfo remains unchanged for the time being. User information can no longer be directly obtained. wx.login wx.getUserInfo I spent some time working on this new interface. Maybe I am not very good at it (no, ヽ(≧□≦)ノ). Anyway, this matter has finally come to a head, right? I hope this can help more friends! <( ̄︶ ̄)> This is the end of this article about the specific use of the wx.getUserProfile interface of the mini program. For more relevant content about the wx.getUserProfile interface of the mini program, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL's conceptual understanding of various locks
>>: Analysis of Hyper-V installation CentOS 8 problem
NC's full name is Netcat (Network Knife), and...
In a recent project, I wanted to align text verti...
Preface In front-end development, we often encoun...
The reason for writing such an article is that on...
Preface I looked at the previously published arti...
How to add css in html? There are three ways to s...
Tips for sending HTML emails: Use style to write ...
Prerequisites A cloud server (centOS of Alibaba C...
1. The relationship between fonts and character d...
My page today also had garbled characters, so I s...
This article example shares the specific code for...
This article uses examples to illustrate the usag...
Preface: Use watermark effect in vue project, you...
Networks usage tutorial Official website docker-c...
The browser displays TIF format images Copy code T...