index.vue 1.51 KB
<template>
  <div style="width: 100%; height: 100%; position: relative" v-if="imgShow">
    <el-image
      :src="url"
      fit="fill"
      style="display: block; width: 100%; height: 100%; opacity: 0.9"
      lazy
    ></el-image>
    <div class="model"></div>
  </div>
</template>
<script>
import indexBackground from "@/assets/images/indexBackground.jpg";
import { getLoginType } from "@/utils/auth";
export default {
  props: {},
  data() {
    return {
      url: "",
      imgShow: false,
      fcl: false,
    };
  },
  created() {
    getLoginType() ? (this.fcl = true) : (this.fcl = false);
    this.checkImgType();
  },
  methods: {
    checkImgType() {
      let interval = setInterval(() => {
        if (
          this.$store.getters.userData.organization &&
          this.$store.getters.userData.organization.code == "customer"
          // ||getToken().split(".")[0] == "2"
        ) {
          clearInterval(interval);
          if (this.fcl) {
          } else {
            this.imgShow = false;
            this.url = "";
            this.$router.push({
              path: "/newui_noentrySreach_parent/newui_noentrySreach_leaf",
            });
          }
        } else if (
          this.$store.getters.userData.organization &&
          this.$store.getters.userData.organization.code != "customer"
        ) {
          clearInterval(interval);
          this.url = indexBackground;
          this.imgShow = true;
        }
      }, 500);
    },
  },
};
</script>

<style rel="stylesheet/scss" lang="scss"></style>