mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-04 00:47:37 +08:00
fix: 修改当前在线人数icon
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<ToolTip v-if="!isMobile" content="当前在线人数" placement="bottom">
|
<ToolTip v-if="!isMobile" content="当前在线人数" placement="bottom">
|
||||||
<div class="online-count">
|
<div class="online-count">
|
||||||
<i class="fas fa-people-group"></i>
|
<peoples-two />
|
||||||
<span>{{ onlineCount }}</span>
|
<span>{{ onlineCount }}</span>
|
||||||
</div>
|
</div>
|
||||||
</ToolTip>
|
</ToolTip>
|
||||||
@@ -143,7 +143,7 @@ async function sendPing() {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("心跳失败", e)
|
console.error('心跳失败', e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,11 +155,10 @@ async function fetchCount() {
|
|||||||
})
|
})
|
||||||
onlineCount.value = await res.json()
|
onlineCount.value = await res.json()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("获取在线人数失败", e)
|
console.error('获取在线人数失败', e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const search = () => {
|
const search = () => {
|
||||||
showSearch.value = true
|
showSearch.value = true
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -311,8 +310,8 @@ onMounted(async () => {
|
|||||||
// 新增的在线人数逻辑
|
// 新增的在线人数逻辑
|
||||||
sendPing()
|
sendPing()
|
||||||
fetchCount()
|
fetchCount()
|
||||||
setInterval(sendPing, 120000) // 每 2 分钟发一次心跳
|
setInterval(sendPing, 120000) // 每 2 分钟发一次心跳
|
||||||
setInterval(fetchCount, 60000) // 每 1 分更新 UI
|
setInterval(fetchCount, 60000) // 每 1 分更新 UI
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ import {
|
|||||||
FileText,
|
FileText,
|
||||||
History,
|
History,
|
||||||
Lightning,
|
Lightning,
|
||||||
|
PeoplesTwo,
|
||||||
} from '@icon-park/vue-next'
|
} from '@icon-park/vue-next'
|
||||||
|
|
||||||
export default defineNuxtPlugin((nuxtApp) => {
|
export default defineNuxtPlugin((nuxtApp) => {
|
||||||
@@ -127,4 +128,5 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
nuxtApp.vueApp.component('FileText', FileText)
|
nuxtApp.vueApp.component('FileText', FileText)
|
||||||
nuxtApp.vueApp.component('HistoryIcon', History)
|
nuxtApp.vueApp.component('HistoryIcon', History)
|
||||||
nuxtApp.vueApp.component('Lightning', Lightning)
|
nuxtApp.vueApp.component('Lightning', Lightning)
|
||||||
|
nuxtApp.vueApp.component('PeoplesTwo', PeoplesTwo)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user