http://blog.csdn.net/wlsyn/article/details/49098383
@RequestMapping(value = { "/getAuthorInfo" })
@ResponseBody
public JsonResult getAuthorInfo(HttpServletRequest request){
JsonResult result = new JsonResult();
try {
String jsapi_ticket = weiXinRequest.getWeiXinTicket();
logger.debug("[jsapi_ticket] = " + jsapi_ticket);
String url = request.getRequestURL().toString();
Map<String, String> ret = sign.sign(jsapi_ticket, url);
logger.debug("[ret] = " + ret);
result.setData(ret);
} catch (Exception e) {
result.setErrorCode(JsonResult.FAILURE);
result.setErrorMsg(e.getMessage());
logger.error(e.getMessage());
}
return result;
}
function callWeChatInterface() {
$.ajax({
type:"POST",
url:"/scan-view/lineExecute/getAuthorInfo",
data:{},
async:false,
success:function(response){
if(response && "1" == response.errorCode){
var result = response.data;
timestamp = result['timestamp'];
nonceStr = result['nonceStr'];
signature = result['signature'];
alert("获取三个参数值成功! timestamp: " + timestamp + " nonceStr: " + nonceStr + " signature: " + signature);
}
}
});
}
<listener>
<listener-class>net.sf.ehcache.constructs.web.ShutdownListener</listener-class>
</listener>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.6.6</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
微信 js sdk 签名
需积分: 10 107 浏览量
2017-05-27
14:56:33
上传
评论
收藏 1.17MB ZIP 举报
李文
- 粉丝: 17
- 资源: 133
最新资源
- 高等数学第一章第二节数列的极限
- Python 版冒泡排序算法源代码
- tensorflow-gpu-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- tensorflow-2.7.3-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-2.7.2-cp39-cp39-manylinux2010-x86-64.whl
- Python版本快速排序源代码
- Python 语言版的快速排序算法实现
- 450815388207377安卓_base.apk
- 超微主板 X9DRE-TF+ bios 支持 nvme启动
- 基于Python通过下载气象数据和插值拟合离散数据曲线实现对寒潮过程的能量分析
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈