php微信分享无效签名,关于微信链接分享一直报签名无效的问题

泰汇智能名片

var url=encodeURIComponent('http://jk.taikang.com');

var shareUrl='http://jk.taikang.com/introduction/card.html';

$.ajax({

url: "https://scrm.taikang.com/api/weshare/getwxfxSign/ashx",

type: "post",

data: JSON.stringify({appId:"wx981c48c631195553",url:url}),//传参数

cache: false,

async : false,

contentType:"application/json;charset=utf-8",

dataType: "JSON",

success: function (data ,textStatus, jqXHR)

{

if(data.code==200){

wx.config({

debug: true, //生产环境需要关闭debug模式

appId: data.data.appId, //appId通过微信服务号后台查看

timestamp: data.data.timestamp, //生成签名的时间戳

nonceStr: data.data.nonceStr, //生成签名的随机字符串

signature:data.data.signature, //签名

jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ','onMenuShareQZone']

});

wx.ready(function() {

wx.onMenuShareTimeline({

title:"泰汇智能名片", // 分享标题

link: shareUrl,// 分享链接

imgUrl: "image/healthCloud.bmp", // 分享图标

success:function(res){

}

}),

wx.onMenuShareAppMessage({

title:"泰汇智能名片", // 分享标题

desc: "最智能的用户连接器", //分享描述

link: shareUrl,// 分享链接

imgUrl: "image/healthCloud.bmp", // 分享图标

success:function(res){

}

}),

wx.onMenuShareQZone({

title:"泰汇智能名片", // 分享标题

desc: "最智能的用户连接器", //分享描述

link: shareUrl,// 分享链接

imgUrl: "image/healthCloud.bmp", // 分享图标

success:function(res){

}

}),

wx.onMenuShareQQ({

title:"泰汇智能名片", // 分享标题

desc: "最智能的用户连接器", //分享描述

link: shareUrl,// 分享链接

imgUrl: "image/healthCloud.bmp", // 分享图标

success:function(res){

}

}),

wx.error(function(res){

console.log(res);

});

})

}

},

error:function (XMLHttpRequest, textStatus, errorThrown) {

//alert("请求失败!");

}

});

*{margin:0;

padding:0;}

img{display: block;

width:100%;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值