Micro-letter +angularjs in the spa application of Router for page jump, JSSDK checksum failure Problem Resolution _ANGULARJS

Source: Internet
Author: User

Today, accidentally put the micro-letter Jssdk Debug opened, found that debugging information always prompts the signature error, the feelings of the two days before the API "occasional" does not take effect, not because the code has not been executed, but because the signature is not correct AH! , this is a 100% error that can be reproduced.

But as long as the Spa has just been refreshed, or after loading the midway without a jump, the signature will be correct.

And when the route changes, we have a new "jump" page to re-sign, but there is a signature error, and our signature is clearly correct, take a variety of parameters to the micro-mail JS Signature Verification tool (http://mp.weixin.qq.com/debug/cgi-bin/ Sandbox?t=jsapisign) to go is the same!

The major discovery of the following ... In fact

Just sign it as soon as you load the SPA entry page, because the URL for the micro-mail signature is like the URL of the first loaded page in the spa ... Window.location.href jump is actually quite loaded again a spa

Once thought that the route jumps, should take the new URL to re-sign, but precisely because of this, the signature check to make a mistake.

So the solution is:

Only signed the first loaded page on the line, with Ui-router jump, it seems just changed the address. And this address is modified. The signature of a micro-letter does not seem to be recognized. He recognized the URL of the first loaded page.

Through this article, I hope to help to meet the problem of friends, thank you for the support of this site!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.