mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
update
This commit is contained in:
24
src/data/notifactions.ts
Normal file
24
src/data/notifactions.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { QueryGetAPI } from '@/api/query'
|
||||
import { useRequest } from 'vue-request'
|
||||
import { NOTIFACTION_API_URL } from './constants'
|
||||
import { NotifactionInfo } from '@/api/api-models'
|
||||
import { useAccount } from '@/api/account'
|
||||
|
||||
const account = useAccount()
|
||||
const { data, loading, run } = useRequest(
|
||||
() => {
|
||||
return QueryGetAPI<NotifactionInfo>(NOTIFACTION_API_URL + 'get')
|
||||
},
|
||||
{
|
||||
errorRetryCount: 5,
|
||||
pollingInterval: 5000,
|
||||
pollingWhenHidden: false,
|
||||
}
|
||||
)
|
||||
|
||||
export const notifactions = () => data
|
||||
export const GetNotifactions = () => {
|
||||
if (account) {
|
||||
run()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user