微信白名单配置与检验

配置

在左边菜单栏最下面一栏“开发”-基本配置中
2
点击查看,进行修改
3
多个IP换行输入即可
4

检验

在网页上打开:(GET方式)
将APPID和APPSECRET替换为自己的appid和secret
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
可以访问的返回结果是

{"access_token":".......","expires_in":......}

错误的返回结果有

{"errcode":40013,"errmsg":"invalid appid hint: [......]"}
{"errcode":40164,"errmsg":"invalid ip XXX.XXX.XXX.XXX, not in whitelist hint: [......]"}

等等
根据返回的错误码和信息,在官方错误码文档中翻查即可

官方资料:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140183

原文地址:https://www.cnblogs.com/Lulus/p/8331152.html