微信公众号




获取全局 的access_token:把下面的appid,secre 换成自己的。,然后回车,就得到了。每过7200秒会失效,,,然后粘贴底部菜单代码即可

https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
 
 
网页授权:access_token和access_token有区别需注意,,拿到此access_token和openid来获取用户信息
{
    "button": [
        {
            "type": "click", 
            "name": "今日歌曲", 
            "key": "V1001_TODAY_MUSIC"
        }, 
        {
            "name": "菜单", 
            "sub_button": [
                {
                    "type": "view", 
                    "name": "搜索", 
                    "url": "http://www.soso.com/"
                }, 
                {
                    "type": "view", 
                    "name": "授权", 
                    "url": "https://open.weixin.qq.com/connect/oauth2/authorize?appid=自己的appid&redirect_uri=【这里是转码之后的地址】https%3A%2F%2Fliupandeng123.applinzi.com%2Fh10demo%2FgetUserinfo.php&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect"
                }, 
                {
                    "type": "click", 
                    "name": "赞一下我们", 
                    "key": "V1001_GOOD"
                }
            ]
        }
    ]
}
 
在php中转码:
<?php
$url = "这里是填自己的服务器地址https://1.xiasize.applinzi.com/h10demo/getUserinfo.php";
$url = urlencode($url);
echo $url;
?>

posted @   ·一库  阅读(180)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示