<template>
  <div>
    <Row class="header">
      <img :src="domainLogo" class="logo" width="220px" />
    </Row>
  </div>
</template>

<script>
import { getBaseSite } from "@/api/common.js";
export default {
  data() {
    return {
      domainLogo: require("@/assets/logo.png"),
      domainIcon: require("@/assets/titleicon.png"),
    };
  },
  methods: {
    getSite() {
      //获取domainLogo
      getBaseSite().then((res) => {
        const { siteName } = JSON.parse(res.result.settingValue);
        localStorage.setItem("title", siteName);
        let link =
          document.querySelector("link[rel*='icon']") ||
          document.createElement("link");
        link.type = "image/x-icon";
        link.href = this.domainIcon;
        link.rel = "shortcut icon";
        document.getElementsByTagName("head")[0].appendChild(link);
      });
    },
  },
  mounted() {
    this.getSite();
  },
};
</script>

<style lang="scss" scoped>
.header {
  margin-bottom: 30px;
}
.logo {
  width: 126px;
  height: 46px;
}
</style>
