关于单页面微信支付目录配置问题

1.1 解决android支付问题 在支付界面改变url

1.2 初始化的时候改变首页url  这个解决ios的支付问题

angular解决方案

constructor(private httpService: HttpService, private router: Router, private location: Location, private activatedRoute: ActivatedRoute ) { 
    // 替换url但不触发刷新,解决支付目录的问题
    this.router.events
      .subscribe((e: any) => {
        if (e instanceof NavigationEnd) {
          if (window.location.href.indexOf('?#') < 0) {
            const productId = localStorage.getItem("productId");
            window.history.pushState(null, null, `?#/index?id=${productId}`);
          };
        }
      })
  }
原文地址:https://www.cnblogs.com/ymh2013/p/11140782.html