DESKTOP-9BNTV8O
2025-03-11 3b87f36219202b4cec47840bd9f56fdbe53e7d04
Web/src/layout/footer/index.vue
@@ -2,17 +2,34 @@
   <div class="layout-footer pb15">
      <div class="layout-footer-warp">
         <!-- <div>{{ themeConfig.globalTitle }}</div> -->
         <div class="mt5">{{ themeConfig.copyright }} {{ themeConfig.globalTitle }}</div>
         <div class="mt5">{{ themeConfig.copyright }} {{ themeConfig.globalTitle }}&nbsp;&nbsp;系统时间:{{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">