Does Mini Program still need to be authorized to log in if he has we.login?

now there is a function: as soon as you enter Mini Program, you have to get the token, from the background before you can continue to display the following operation page, etc. After reading the document, you can get a code, with wx.login, and you can first interact with the backend with this. I don"t know whether I think this is right or not when I get token,.
1. If I just need this token, do I still need to use the authorization button to authorize it?
2. If I need authorization, I will put the authorization page at the top of the pages of app.json, and as soon as I open Mini Program, I will directly enter from this file, so if the user has been authorized, how can he skip this page and go directly to the home page? Jump to the authorization page without authorization?

Mar.17,2021

  1. Authorization can obtain other information: user information (mainly nicknames and avatars), phone number
  2. check the login status in the onLoad of this page, and jump to
  3. after logging in.

first of all, wx.login () is not what you understand as the login operation we usually talk about. This API is used by Mini Program to give you a code and then let you use this code to interact on the server interface to further obtain Wechat user information. It does not perform any authorization operations.

API related to authorization is found in document = > Settings column-- wx.openSetting and wx.getSetting

Previous: Antd form with initial value

Next: Why is the auido tag not called when calling the play () method in Wechat browser?

Menu