1, the calculated signature is consistent with the sandbox provided by WeChat: http://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=jsapisign
2. Tried to use two methods to solve the problem, but still got the same error: 1), pass the URL from the local to the server, get the json data of the server through ajax, and then fill in the content of wx.config; 2), get it from the server Link to this visit
3. Use nginx as reverse domain name proxy, but it has been processed for upstream
Conclusion: It is suspected that WeChat’s JSSDK has a bug
May need to be checked
1) Do you cache WeChat’s jsticket globally on the server? After a new jsticket is obtained, the original jsticket (including access_token) will be refreshed
2) Whether the url is consistent, including query string, etc.
3) Whether nonceStr and timestamp are consistent with the signature
I also suspect there is a bug. The invalid signature is invalid under android, but it is correct under ios. And it is passed on the official debugging page. I wonder if the original poster has solved it now?
Perhaps
url
传入的问题,建议wx.config
is generated through the background and then written to the foreground.Like mine
Then
Has the poster’s problem been solved? I have the same problem. Anyway, I also tested the interface for comparison with WeChat’s testing tool, but it keeps showing invalid signature
The signature is the same as the official one, and the URL is also obtained through location.href.split('#')[0]. . It also keeps prompting config:invalid signature. The JS interface security domain name of the official account is also configured OK, but not working. . Ask God for help,
Test address: http://weixin.zhjckx.com/ApiWeiXin/JsSdk
Check out my answer from another person:
/q/1010000002502269/a-1020000002549180X2X
The situation I encountered was that when obtaining the current URL when generating a signature, the URL:full() method of the laravel framework was used. As a result, this method will rearrange the order of the query string in the URL. For example, the url when you visit is
, the result obtained by using URL:full() is
Changed to the honest and practical WeChat official example:
It’s OK.
I modified it myself and tested it ok. The reason is because the official httpGet function cannot be used.
Tell me these two sentences in jssdk.php