search

Home  >  Q&A  >  body text

php - Where should the obtained WeChat user nickname and avatar be saved?

In the project, you need to obtain the WeChat user's avatar and nickname. If the nickname and avatar URL are saved in the database, the information will not be updated in time, and the original URL will become invalid after changing the avatar. Should I download the avatar locally? What if other methods are used? Which method is more reasonable?

我想大声告诉你我想大声告诉你2805 days ago1299

reply all(4)I'll reply

  • 黄舟

    黄舟2017-05-16 13:02:32

    H5 local storage

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 13:02:32

    Each OpenID used is unique and needs to be stored in the database. The avatar nickname may change and the expiration time of the stored session setting is changed. Personal opinion

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 13:02:32

    Be sure to save the database, including openid. If you have high requirements for updating your WeChat username and avatar, make scheduled tasks to update them regularly.
    If you only need to update the avatar, access the avatar address regularly. If it does not exist, call the interface to query WeChat user information and update the database.

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 13:02:32

    I also encountered this problem. When logging in with WeChat, the avatar of the WeChat user is captured, but what should I do if the user changes the avatar?

    reply
    0
  • Cancelreply