<template>
  <div>页面跳转中......</div>
</template>

<script>
import local from "@/utils/local";
import { mapMutations } from "vuex";
import { calcMenu } from "@/router";
// import { getSiteTree } from "@/services/businessMatter";
export default {
  data() {
    return {
      portal: process.env.VUE_APP_API_portal_URL,
    };
  },
  created() {
    this.getInfo();
  },
  methods: {
    ...mapMutations(["SET_sysName", "SET_sysLogo", "SET_token", "SET_path"]),
    // 获取token和站点信息
    async getInfo() {
      let { token, siteid, sysName, sysLogo, path } = this.$route.query;
      if (token) {
        local.setLocal("sampleSiteId", siteid);
        this.SET_token(token);
        this.SET_sysName(sysName);
        this.SET_sysLogo(sysLogo);
        this.SET_path(path);
        calcMenu();
        this.$router.push("/basicsset");
      } else {
        this.$message.warning("跳转失败，请重新登录");
        setTimeout(() => {
          location.href = this.portal;
        }, 2000);
      }
    },
  },
};
</script>

<style lang="less" scoped>
</style>