process:
A: not registered: 1. Click on the system entry in the user"s official account-> 2. Initiate authorization callback-> 3. Pull user information openid- > 4. Query database-> 5. If there is no such openid- > 6. Save to database, save session- > 7. Redirect to the system registration page-> 8. Fill in the mobile phone number-> 9. The mobile terminal requests to obtain the verification code. at this time, the backend saves the user"s mobile phone number and associates it with the openid,. How to distinguish the user? -> 10. Register-> 11 Registered successfully-> 12. Return to the home page of the official website (not the home page of the system)
B: registered: 1. Click on the system entry in the user"s official account-> 2. Initiate authorization callback-> 3. Pull user information openid- > 4. Query database-> 5. Save the openid, to session- > 6. Redirect to system function entry-> 7. Select function entry-> 8. Submit the form-> 9. The mobile terminal requests to transfer parameters to the background to save the database
< hr > question: when A-> 9 steps, the session, cannot be read, or how can I maintain the login status of the user?
my idea: when the step A-> 6, a token string is generated according to the user"s openid and returned to the user. After the user jumps, it can be taken to the background to identify when the API is requested. The key is how to return the token to the user? The user is redirected to the system registration page. Can the token front end get it?
I hope you can communicate.
Don"t consider the redis cache method for the time being
has been solved. Take token as a parameter when redirecting.