Home  >  Article  >  Backend Development  >  When doing activities on WeChat, user information will be stored locally. The problem is that the avatar has expired. What should I do? WeChat does not notify me? ? ?

When doing activities on WeChat, user information will be stored locally. The problem is that the avatar has expired. What should I do? WeChat does not notify me? ? ?

WBOY
WBOYOriginal
2016-09-23 11:31:061312browse

To get user information when doing activities on WeChat, I store the user information returned to me by WeChat in a local database to avoid getting it from WeChat every time. But there is a problem. If the user changes his avatar during the activity, but the avatar I use is the WeChat one. Once it was returned to me, I got it from the database. This caused the avatar to be invalid, and if the user modified the WeChat avatar, WeChat would not notify me. What should I do? ? ? Can anyone give me some ideas? Thank you very much~~

Reply content:

To get user information when doing activities on WeChat, I store the user information returned to me by WeChat in a local database to avoid getting it from WeChat every time. But there is a problem. If the user changes his avatar during the activity, but the avatar I use is the WeChat one. Once it was returned to me, I got it from the database. This caused the avatar to be invalid, and if the user modified the WeChat avatar, WeChat would not notify me. What should I do? ? ? Can anyone give me some ideas? Thank you very much~~

That’s what I think. Some users are paying attention and some are not, so you must use the first interface, the one that clicks on the authorization button
Since you want to authorize, then directly update the database with the authorized information.
Anyway, as soon as the user comes in, it will be judged whether there is a session. If not, it will be judged by cookies and login. If there is no session, the user will be authorized. Anyway, once authorized, you will update the user's information.

You already have openid, and the user has recently authorized it. It should be feasible to use it unilaterally to capture user information. Users I have followed before can simply use openid+accesstoken to capture user information.
You try the following people

1: Follow
2: Not follow, not authorized
3: Not follow, authorized

You can try these three types of people using the interface below. If 1 and 3 are feasible, then what you want is feasible.

When doing activities on WeChat, user information will be stored locally. The problem is that the avatar has expired. What should I do? WeChat does not notify me? ? ?

There is still no way to completely avoid interacting with WeChat.
In fact, changing the avatar is not a high-frequency action, and the inconsistency of the avatar has little impact, and the delay is bearable. If you really have high requirements in this regard, you can only do it every time Request user information once for comparison.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn