WeChat get user basic information, Avatar is a "temporarily unable to view" figure?

Source: Internet
Author: User

It's this http://wx.qlogo.cn/mmopen/. uaqwj95hslycmqktiqayuexoytj3kjzknq4icjknpfuvxfqonrdy2eskqj3yvxxuqacsu9fykdq1vusvbxspic4mwndtf4z4zu/0

I see the figure is the following, the previous user's avatar is normal, but recently found to be so, he did not change his avatar.

Could it be, the avatar address changed?

Now, I re-give him to get the information, the original image URL can be used, and I found that there is a logical change: Before the user authorization, need to obtain user information again whenever the snsapi_base request is made, not now, must be initiated snsapi_userinfo by the request, Otherwise you will be reported 48001 error (API function is not authorized, please confirm that the public number has access to the interface, you can view the interface permissions on the public platform website-Developer Center page), and snsapi_userinfo the request will not pop up require users to click on the authorization page, do not prompt "You have recently authorized ...".

Now that's the problem, how do I tell if the picture looks like it? So that I can retrieve his information again in time?

Reply content:

It's this http://wx.qlogo.cn/mmopen/. uaqwj95hslycmqktiqayuexoytj3kjzknq4icjknpfuvxfqonrdy2eskqj3yvxxuqacsu9fykdq1vusvbxspic4mwndtf4z4zu/0

I see the figure is the following, the previous user's avatar is normal, but recently found to be so, he did not change his avatar.

Could it be, the avatar address changed?

Now, I re-give him to get the information, the original image URL can be used, and I found that there is a logical change: Before the user authorization, need to obtain user information again whenever the snsapi_base request is made, not now, must be initiated snsapi_userinfo by the request, Otherwise you will be reported 48001 error (API function is not authorized, please confirm that the public number has access to the interface, you can view the interface permissions on the public platform website-Developer Center page), and snsapi_userinfo the request will not pop up require users to click on the authorization page, do not prompt "You have recently authorized ...".

Now that's the problem, how do I tell if the picture looks like it? So that I can retrieve his information again in time?

Question 1: file_get_contents come back to you ~ The reason you appear that figure is Curl when the head of the problem caused. or pull directly with the SDK.
Question 2: snsapi_base is the basic permission, can only get the nickname Avatar, other permissions are not. Including the previous unionid , but also inexplicably lost. Specification of permissions. snsapi_userinfois the user information, in addition to the Avatar nickname, has all other API permissions. As for the strong cache that you don't have to authorize or have recently. Directly cache the link after the jump, and that link you are valid reasons, not everyone does not play.
The last question. Well, if you really want to judge. You get a picture that shows that, take it back and record the size of the file, or MD5. Get the same as that is the way it is ~ ~ Haha.

There is wood to get user information, including user name and Avatar, thank you for sharing 742538662@qq. Com

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.