微信企业号开发总结

摘要:近来负责公司的微信企业号开发,主要用到了微信企业号的两个接口,一个是获取access_token接口,另一个是网页授权接口,在开发过程中还是遇到些问题,现在做个总结。

1.生产环境调用微信获取token的接口报错信息?
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

解决办法:
(1).导入证书,具体做法请自行google,网上都有很多例子
(2).在调用接口的时候忽略https,把https请求当做http请求处理

2.微信浏览器页面兼容性问题(页面左右滑动问题)?
解决办法:
(1).在每个页面引入viewport
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
(2).去掉body的整体宽度,类似100%这样的宽度设置都去掉

3.tomcat容器重启后,点击企业号应用,没有返回正确的菜单?
解决办法:
(1).在index.html增加浏览器缓存设置,设置成不缓存
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
(2).在index.html页面引入js的地方,增加随机数
<script src="/bidata_front_web/static/lib/js/login/wechat_index.js?r="+Math.random() type="text/javascript"></script>
(3).在重定向的地址后面加随机数
return "redirect:" + "/login/loginSubmit?t="+Math.random();

4.jquery执行ajax后,默认加载没问题,但是刷新页面,出现图表样式丢失的情况?
解决办法:

(1).把页面的引入css的时候放到js的前面



猜你喜欢

转载自blog.csdn.net/sxdtzhaoxinguo/article/details/76098565