Vue.js single-page application uses Wechat js sdk signature invalid signature

create a project using vue-cli , and axios request the server to obtain appid and other information. url parameter is encodeURIComponent (window.location.href.split ("- sharp") [0]) , vue-router is hash mode,
wx.config still report error after configuration, error message is as follows
config:fail,Error: invalid signature

add that testing in a separate html can be configured successfully


is this a problem with background signature configuration


1, jsapi_ticket error
2, signature algorithm problem
3, noncestr's's'in algorithm parameters is lowercase, nonceStr's'in wx.config is uppercase, please distinguish
4, make sure that url is the complete url of the page (please confirm in the current page alert (location.href.split ('- sharp') [0]), including the 'http (s): / /' section, And'?' The following GET parameters section, but does not include the part after'- sharp'hash
reference document: https://mp.weixin.qq.com/wiki. Appendix 5


solves the problem of data format returned in the background.

Menu