redjrectLogin.vue 2.12 KB
<template>
  <div class="relogin" v-loading="loading"></div>
</template>

<script>
import {
  getToken,
  setToken,
  removeToken,
  setLoginType,
  setEntrySreachType,
} from "@/utils/auth.js";
import { checkUserName, getUnlock } from "@/api/system/user.js";

export default {
  data() {
    return {
      url: "",
      loading: false,
    };
  },
  mounted() {
    this.loading = true;
    if (this.$route.query.token) {
      //外部登录
      removeToken();
      // /relogin?token=&consignmentCode= magic测试地址
      setToken(decodeURI(this.$route.query.token));
      // if (
      //   Number(this.$route.query.consignmentCode) != 1 ||
      //   this.$route.query.consignmentCode == undefined
      // ) {
      //   setLoginType(
      //     JSON.stringify({
      //       consignmentCode:
      //         this.$route.query.consignmentCode == undefined
      //           ? "noCode"
      //           : this.$route.query.consignmentCode.replace(/\s+/g, ""),
      //       status:
      //         this.$route.query.consignmentCode == undefined ? "" : "magicFcl",
      //     })
      //   );
      // }
      location.replace(process.env.VUE_APP_BASE_ROUTE);
    } else {
      this.$router.push({ path: "/login" });
      this.loading = false;
    }
  },
  methods: {
    //运单申报使用字典
    async setDict() {
      // this.$store.dispatch("GetDistrict");
      // this.$store.dispatch("GetPort", { name: "", type: "all" });
      // let arr = [
      //   "VehicleWayCode",
      //   "supervisionMode",
      //   "natureExemption",
      //   "ClinchType",
      //   "NewPackageType",
      //   "Country",
      //   "levyType",
      //   "currencySystem",
      //   "ENTRY_METHOD",
      //   "pickUpCity",
      //   "consType",
      //   "brandType",
      //   "exportBenefits",
      // ];
      // arr.forEach((item, index) => {
      //   this.$store.dispatch("GetDict", {
      //     dictionaryCode: item,
      //     extIndex: "",
      //     extVal: "",
      //   });
      // });
    },
  },
};
</script>

<style lang="scss" scoped>
.relogin {
  width: 100%;
  height: 100%;
  background-color: #fff;
}
</style>