A, in the small program project login, access to the current token, this login, is a small program in a key, but also difficult, because in the company’s project development process, will certainly involve the user’s login, so, this to as far as possible to give him thorough digestion. What about the general process:

1. The code of the current user can be obtained by wx.login({}) provided by the small program; 2. A token will be returned to us when we request the background address according to the returned code. When entering the project page, we will first determine whether the user has logged in. 3. Wx.getuserinfo ({}) can also be used to obtain details about the current user, or button open-type="getUserInfo"  bindgetUserInfo="Callback method to retrieve user information", wx.request({}) to request backend users to register in the backend databaseCopy the code

Two, feel oneself really is know too little, in the future study, also have to expand knowledge

3. The problem we encountered today was that when we wanted to add our users to the background database, we kept quoting 500 and the OpenID was wrong. Finally, we discussed and solved the problem in a meeting, but we found that there were problems in our request method and code transmission