search

Home  >  Q&A  >  body text

php - 获取到的微信用户昵称及头像应该保存在哪里?

项目中需要获取微信用户头像及昵称。如果是把昵称和头像url保存到数据库的话,信息会无法及时更新,而且更换头像后原来的url会失效,应该下载头像到本地吗?如果是用其他方式的话又如何,请问哪种方式比较合理。

我想大声告诉你我想大声告诉你2738 days ago1267

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