微信JS-SDK加载验证流程

参考链接:http://blog.bwphp.cn/?p=617

access_token);
 
$jsapi_ticket_json = file_get_contents('https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token='.$data->access_token.'&type=jsapi');
$jsapi_ticket_obj = json_decode($jsapi_ticket_json);
$jsapi_ticket = $jsapi_ticket_obj->ticket;
$noncestr = 'qwertyuiop';
$timestamp = time();
 
$signature = sha1(sprintf('jsapi_ticket='.$jsapi_ticket.'&noncestr='.$noncestr.'×tamp='.$timestamp.'&url=http://zhangsixia.bwphp.cn/wei1.php'));
echo $signature;
?>
 


wx.config({
        debug: true,
        appId: '',
        timestamp: ,
        nonceStr: '',
        signature: '',
        jsApiList: ['uploadImage','downloadImage']
});
 
wx.ready(function(){
        wx.checkJsApi({
                jsApiList: ['chooseImage'],
                success: function(res) {}
        });
        wx.chooseImage({
                success: function (res) {
                        var localIds = res.localIds;
                }
        });
});
wx.error(function(res){
    alert('no');
});

网站栏目:微信JS-SDK加载验证流程
网页网址:http://scyanting.com/article/gijpdc.html