preface

Window. Location. Href; window. It does work, but you must enter the page and refresh the page again to sign successfully. Timestamps do not solve the flush problem

methods

In mian. Js, the global route guard post hook afterEach to actively modify the URL to add a link description

window. The router = the router; router.afterEach(to= > {
  const u = navigator.userAgent.toLowerCase();
  if (
    u.indexOf("like mac os x") < 0 ||
    u.match(/MicroMessenger/i) != "micromessenger"
  )
    return;
  if(to.path ! = =global.location.pathname) { location.assign(to.fullPath); }});Copy the code

Testing window.location.href is useful, but you need to refresh the page again for the signature to succeed! Window.location. href cannot be signed immediately after jumping into it; Changing the global route guard back hook does not require changing the way push switches pages, which change the url when it is on ios. There’s also a window. Location. href jump that doesn’t work well and refetches the data

IOS wechat sharing problem (H5 page), invalid signature reported