<template>
  <div class="login-home">
    <div class="login login-box">
      <div class="login-theme">
        <h2> 云阅卷 <span>2.0</span> </h2>
        <p>全新升级</p>
      </div>
      <div class="login-body">
        <div>
          <router-view></router-view>
        </div>
      </div>
    </div>

    <p class="login-footer">
      <a href="http://www.qmth.com.cn" target="_blank">
        Copyright © 2024 启明泰和
      </a>
      <span v-if="appStore.system.versionName">
        {{ appStore.system.versionName }}
      </span>
      <span v-if="appStore.system.versionDate">
        {{ appStore.system.versionDate }}
      </span>
      <a href="https://beian.miit.gov.cn/" target="_blank">
        鄂ICP备12000033号-3</a
      >
    </p>
  </div>
</template>

<script setup lang="ts">
  import { onMounted } from 'vue';
  import { useAppStore } from '@/store';
  import { systemVersion } from '@/api/user';

  defineOptions({
    name: 'LoginHome',
  });

  const appStore = useAppStore();

  async function getVersion() {
    const systemInfo = await systemVersion();
    appStore.setInfo({
      system: systemInfo,
    });
  }

  onMounted(() => {
    getVersion();
  });
</script>
