<template>
  <div class="login-home">
    <div class="login-header">
      <div class="logo-school">
        <template v-if="schoolInfo.schoolCode === 'admin'">
          <img src="@/assets/images/qmth-logo.png" alt="admin logo" />
        </template>
        <template v-else>
          <img :src="schoolInfo.logo" alt="学校logo" />
        </template>
      </div>
      <div class="logo-divider"></div>
      <div class="logo-system">
        <img src="@/assets/images/system-logo.png" alt="system logo" />
      </div>
    </div>
    <div class="login-container" :style="containerStyles">
      <router-view></router-view>
    </div>
    <div class="login-footer">
      <p>
        <a href="http://www.qmth.com.cn" target="_blank"
          >Copyright © 2024 启明泰和</a
        >
        <a href="https://beian.miit.gov.cn/" target="_blank"
          >鄂ICP备12000033号-9</a
        >
        <span v-if="version"> v{{ version }}</span>
      </p>
    </div>
  </div>
</template>

<script>
export default {
  name: "login-home",
  data() {
    return {
      version: "",
      schoolInfo: {
        logo: "",
        backgroundImageUrl: "",
      },
    };
  },
  computed: {
    containerStyles() {
      return this.schoolInfo.backgroundImageUrl
        ? {
            backgroundImage: `url(${this.schoolInfo.backgroundImageUrl})`,
          }
        : {};
    },
  },
  methods: {},
};
</script>
