fix event get

This commit is contained in:
2024-02-28 17:54:43 +08:00
parent f1c06deffd
commit da23cdf3e3
5 changed files with 20 additions and 21 deletions

View File

@@ -3,7 +3,7 @@ import { isDarkMode } from '@/Utils'
import { useAccount } from '@/api/account'
import { QueryGetAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import { AVATAR_URL, BASE_API } from '@/data/constants'
import { AVATAR_URL, BASE_API, EVENT_API_URL } from '@/data/constants'
import { Grid28Filled, List16Filled } from '@vicons/fluent'
import { format } from 'date-fns'
import { saveAs } from 'file-saver'
@@ -86,7 +86,7 @@ async function onDateChange() {
}
async function get() {
try {
const data = await QueryGetAPI<EventModel[]>(BASE_API() + 'event/get', {
const data = await QueryGetAPI<EventModel[]>(EVENT_API_URL + 'get', {
start: selectedDate.value[0],
end: selectedDate.value[1],
})

View File

@@ -4,10 +4,25 @@ import { onMounted, onUnmounted, ref } from 'vue'
const webFetcher = useWebFetcher()
onMounted(() => {
webFetcher.Start()
let timer: any
onMounted(async () => {
await webFetcher.Start()
setTimeout(() => {
// @ts-expect-error obs的东西
if (!webFetcher.isStarted && window.obsstudio) {
timer = setInterval(() => {
if (webFetcher.isStarted) {
return
}
webFetcher.Stop()
webFetcher.Start()
}, 20000)
}
}, 10000)
})
onUnmounted(() => {
clearInterval(timer)
})
onUnmounted(() => {})
</script>
<template>