php - WeChat public account stores user information and how to guide unfollowed users to follow
怪我咯
怪我咯 2017-05-24 11:33:55
0
3
758

I have never developed a WeChat public platform before. Recently, a project has the following doubts:
1. The demand is like this. After the user follows the public account, the openid is obtained and stored in the session. The front-end and back-end are separated, and the menu of the official account is in the form of URL. So when a WeChat user operates, if the session expires, should they use silent authorization to log in?
2. The user enters through the shared page, and the user needs to be a member to operate. If the user is only authorized to log in, because the public account administrator needs to be able to send information to members later, authorized users cannot obtain the public platform. News, then do you need to guide users to pay attention before continuing the operation? How to guide?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(3)
漂亮男人

Authorize to obtain user information => Get whether the user has followed the official account =>

   switch{
       已关注 => 继续操作
       未关注 => 展示个二维码 或者..                                                         
   }
     

                               
为情所困

First of all, the session storage of WeChat browser is temporary. If you enter your webpage in the morning, the session will be gone when you enter again at noon. The session is only used for one visit. Every time the user enters from the official account menu Everyone should use authorization. It is best to use snsapi_userinfo for authorization. User data can be pulled without user attention. When users who have followed them come in, they will default to silent authorization. As for how to guide users to follow your official account, that is up to you. It’s about operations

我想大声告诉你

Storing is the same as how you usually store users, just multiple openids. People who come in from the public account are automatically logged in, and basically don’t need to be processed. Sharing can only create a guide page for users to actively follow. Now it does not support direct triggering by users. Followed

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template