mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-06 23:21:16 +08:00
fix: 修改当前在线人数icon
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<ToolTip v-if="!isMobile" content="当前在线人数" placement="bottom">
|
||||
<div class="online-count">
|
||||
<i class="fas fa-people-group"></i>
|
||||
<peoples-two />
|
||||
<span>{{ onlineCount }}</span>
|
||||
</div>
|
||||
</ToolTip>
|
||||
@@ -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
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user