公众号微信朋友圈分享提示签名失败 easywechat 微信朋友圈分享签名失败

config:fail,Error: 系统错误,错误码:63002,invalid signature

uniapp微信公众号朋友圈分享失败 config:fail,Error: 系统错误,错误码:63002,invalid signature

vue微信公众号朋友圈分享失败 config:fail,Error: 系统错误,错误码:63002,invalid signature

1.调试注意的地方,分享出去的必须是当前页面,

例如我分享链接地址是 https://d-fangfei.bigchun.com/h5/#/daka

前端需要传一个url分享路径给后端,作为签名使用,

url域名后面必须加/斜杠结尾 例如 https://d-fangfei.bigchun.com/h5/

#/data参数不能参与签名,参与就会导致报错

需要特别注意,触发调用微信分享的页面路径必须,和设置url参数路径一致,不能有#号后面的参数参与签名

有问题可以进裙找我交流721200119,我是裙主

2.以下是我使用easywechat的调用

 $config = get_addon_config('epay')['wechat'];
        $options  = [
            'app_id' => $config['app_id'],
            'secret' => $config['app_secret'],
        ];
        $app = new Application($options);
        $input = input();
        if(!empty($input['debug'])){
           $res = $app->js->ticket();
        }
        $js = $app->js;
        $api = [
            'updateTimelineShareData','updateAppMessageShareData','onMenuShareAppMessage','onMenuShareTimeline','showMenuItems'
        ];
        if(empty($input['url'])){
           $this->error('url必传');
        }
        $url = $input['url']; //url域名后面必须加 例如 https://d-fangfei.bigchun.com/h5/
        $js->setUrl($url);
        $json = $js->config($api, $debug = true, $beta = false, $json = true);
        $share = json_decode($json,true);
        $share['ticket'] = $app->js->ticket();
        if(empty($share)){
            $this->error('分享签名出错');
        }
        $this->success('成功', $share);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章