<template>
  <div class="app-container welcome-container">
    <div class="welcome-content">
      <div class="time-display">{{ currentTime }}</div>
      <div class="system-name">{{ systemName }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Welcome',
  data() {
    return {
      currentTime: '',
      systemName: process.env.VUE_APP_TITLE,
      timer: null
    }
  },
  mounted() {
    this.updateTime()
    this.timer = setInterval(this.updateTime, 1000)
  },
  beforeDestroy() {
    if (this.timer) {
      clearInterval(this.timer)
    }
  },
  methods: {
    updateTime() {
      const now = new Date()
      this.currentTime = now.toLocaleString('zh-CN', {
        year: 'numeric',
        month: '2-digit',
        day: '2-digit',
        hour: '2-digit',
        minute: '2-digit',
        second: '2-digit',
        weekday: 'long'
      })
    }
  }
}
</script>

<style scoped>
.welcome-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 84px); /* 减去头部和padding的高度 */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.welcome-content {
  text-align: center;
  color: white;
}

.time-display {
  font-size: 36px;
  font-weight: 300;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.system-name {
  font-size: 48px;
  font-weight: bold;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
}
</style>
