Joke Collection Website - Public benefit messages - Adjustment of user information acquisition interface of WeChat applet

Adjustment of user information acquisition interface of WeChat applet

wechat applet has adjusted the interface for obtaining user information. Calling wx.getUserInfo(Object object) will no longer be prompted by pop-up authorization. When authorized, you can directly obtain user information; Otherwise, directly enter the fail callback function.

the user's authorization status can be judged by the result of the request of wx.getSetting () interface

res.authsetting ['scope.userinfo'].

then after the interface is adjusted, the authorized login needs to be realized through open-data.

note: if the user's wechat version does not support open-data, you need to prompt the user to upgrade. In fact, the adjustment of the interface has changed the operation of pressing the authorization button in the pop-up window once into the operation of pressing it twice, and it is necessary to design an additional authorization page or conduct a pop-up window on the home page to guide the user to authorize. It's actually more complicated.