北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
lixuliang
2024-08-07 a916fc2df00bac9f8210b09fd7ee79f8b291e345
src/components/login.vue
@@ -9,36 +9,29 @@
    return {};
  },
  mounted() {
     this.$router.push("/index");
    // this.getQueryString("focus-open-code");
    // if (
    //   window.location.href.match(/=(\S*)#/) &&
    //   window.location.href.match(/=(\S*)#/)[1] != ""
    // ) {
    //   this.passFree();
    // }
    // 测试版本免登录
    // this.$router.push({
    //   path: "/home",
    //   query: { showlayer: this.$route.query.showlayer }
    // });
    // // 京办免密登录(url带参"focus-open-code")
    // if (this.$route.query["focus-open-code"]) {
    //   this.passJBFree();
    // }
    // 正式版第三方登录
    this.getQueryString("focus-open-code");
  },
  methods: {
    getQueryString(name) {
      this.$router.push("/index");
      // var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
      // var r = window.location.search.substr(1).match(reg);
      // if (r != null) {
      //   this.$router.push("/index");
      // }
      // return null;
    },
    // 京办免密登录
    // passJBFree() {
    //   // this.$router.push("/index");
    // },
  },
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);
      if (r != null) {
        this.$router.push({
          path: "/index",
          query: { showlayer: this.$route.query.showlayer }
        });
      }
      return null;
    }
  }
};
</script>