<template>
|
<div class="layout-footer pb15">
|
<div class="layout-footer-warp">
|
<!-- <div>{{ themeConfig.globalTitle }}</div> -->
|
<div class="mt5">{{ themeConfig.copyright }} {{ themeConfig.globalTitle }} 系统时间:{{currentTime }}</div>
|
</div>
|
</div>
|
</template>
|
|
<script setup lang="ts" name="layoutFooter">
|
import { ref } from 'vue';
|
import { storeToRefs } from 'pinia';
|
import { useThemeConfig } from '/@/stores/themeConfig';
|
|
const storesThemeConfig = useThemeConfig();
|
const { themeConfig } = storeToRefs(storesThemeConfig);
|
|
const currentTime=ref('');
|
getCurrentTime();
|
let timer;
|
timer = setInterval(getCurrentTime, 1000); // 每秒更新一次
|
function getCurrentTime() {
|
const now = new Date();
|
const year = now.getFullYear();
|
const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以要加1
|
const day = String(now.getDate()).padStart(2, '0');
|
const hours = String(now.getHours()).padStart(2, '0');
|
const minutes = String(now.getMinutes()).padStart(2, '0');
|
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
currentTime.value ='2025年02月21日 14:33:36'//`${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.layout-footer {
|
width: 100%;
|
display: flex;
|
|
&-warp {
|
margin: auto;
|
color: var(--el-text-color-secondary);
|
text-align: center;
|
animation: error-num 0.3s ease;
|
}
|
}
|
</style>
|