php - 获取到的微信用户昵称及头像应该保存在哪里?
我想大声告诉你
我想大声告诉你 2017-05-16 13:00:32
0
4
1197

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

我想大声告诉你
我想大声告诉你

reply all(4)
黄舟

H5 local storage

大家讲道理

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

过去多啦不再A梦

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.

左手右手慢动作

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?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!