问题:
微信JS-SDK 自定义分享:第一次分享显示标题图片,点进去再次分享不显示标题图片,报错无效签名
原因:
从第一分享到微信的链接点进去,微信会给url后会拼接https://xxxxxx.com/xxx.html?from=singlemessage&isappinstalled=0
解决:
刚开始就知道是URL的原因,解决踩坑是一直以为传给后台的url改变导致的无效签名,各种截取后再传仍不能解决,最后发现是页面的地址加了?from=singlemessage&isappinstalled=0
emmmm 加入下面就好了
var link = window.location.href.split("?")[0]; if(link !== window.location.href) { window.location.href = link; }