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);