Article From:https://segmentfault.com/q/1010000011099781
Question:

To develop a WeChat public store, the IOS terminal will adjust the pits that WeChat has paid, and the Internet says that one can be added in front of the number. Number solution, but don’t know this? How to add the number to the server, or to configure it in vue-router?

Answer 0:

My solution now is to force the refresh once I enter the payment page, so that the authorized domain names of Android and IOS are unified.

if (isIos) {
    if (sessionStorage.getItem('flag')) {
        sessionStorage.removeItem('flag')
    } else {
        sessionStorage.addItem('flag')
        location.reload()
    }
}

The pro test is feasible, and there is no test for adding hello before hash.

Answer 1:

I saw a way to hack on the Internet before (but I haven’t tried it yet).

I usually use the history mode directly

The address is as follows: http://greedying.com/posts/pr…

function directRightUrl () {
  let { href, protocol, host, search, hash } = window.location
  const pathname = '/frontend/' // To fix the prefix added to the payment path problem, replace it with yours.Search = searchHash = hash.Let newHref = `${protocol}//${hOst}${pathname}${search}${hash}`If (newHref! = = href) {Window.location.replace (newHref)}}

Answer 2:

Add ‘?’ to the base parameter of Router
Example: base: ‘/?

This method is feasible, but using WeChat to return will return the pages, and experience is not good. Suggest IOS direct load page.

Answer 3:

(window.location.href).replace(this.$route.path,”)

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *