From 5738ce75e83f53eba6b3e1be329fb26de35ddea8 Mon Sep 17 00:00:00 2001 From: tim Date: Sat, 6 Sep 2025 21:09:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E4=BA=BA=E6=95=B0icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/components/HeaderComponent.vue | 11 +++++------ frontend_nuxt/plugins/iconpark.client.ts | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend_nuxt/components/HeaderComponent.vue b/frontend_nuxt/components/HeaderComponent.vue index c68277463..7949a28bb 100644 --- a/frontend_nuxt/components/HeaderComponent.vue +++ b/frontend_nuxt/components/HeaderComponent.vue @@ -39,7 +39,7 @@
- + {{ onlineCount }}
@@ -143,7 +143,7 @@ async function sendPing() { method: 'POST', }) } catch (e) { - console.error("心跳失败", e) + console.error('心跳失败', e) } } @@ -155,11 +155,10 @@ async function fetchCount() { }) onlineCount.value = await res.json() } catch (e) { - console.error("获取在线人数失败", e) + console.error('获取在线人数失败', e) } } - const search = () => { showSearch.value = true nextTick(() => { @@ -311,8 +310,8 @@ onMounted(async () => { // 新增的在线人数逻辑 sendPing() fetchCount() - setInterval(sendPing, 120000) // 每 2 分钟发一次心跳 - setInterval(fetchCount, 60000) // 每 1 分更新 UI + setInterval(sendPing, 120000) // 每 2 分钟发一次心跳 + setInterval(fetchCount, 60000) // 每 1 分更新 UI }) diff --git a/frontend_nuxt/plugins/iconpark.client.ts b/frontend_nuxt/plugins/iconpark.client.ts index 03c3da450..950fafa07 100644 --- a/frontend_nuxt/plugins/iconpark.client.ts +++ b/frontend_nuxt/plugins/iconpark.client.ts @@ -62,6 +62,7 @@ import { FileText, History, Lightning, + PeoplesTwo, } from '@icon-park/vue-next' export default defineNuxtPlugin((nuxtApp) => { @@ -127,4 +128,5 @@ export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.component('FileText', FileText) nuxtApp.vueApp.component('HistoryIcon', History) nuxtApp.vueApp.component('Lightning', Lightning) + nuxtApp.vueApp.component('PeoplesTwo', PeoplesTwo) })