This commit is contained in:
2023-10-07 07:30:33 +08:00
parent 64a6bece5c
commit 7ecf576515
19 changed files with 970 additions and 549 deletions

View File

@@ -2,6 +2,7 @@ const debugAPI = import.meta.env.VITE_DEBUG_API
const releseAPI = `${document.location.protocol}//api.vtsuru.live/`
export const BASE_API = process.env.NODE_ENV === 'development' ? debugAPI : releseAPI
export const FETCH_API = 'https://fetch.vtsuru.live/'
export const FIVESING_SEARCH_API = 'http://search.5sing.kugou.com/home/json?sort=1&page=1&filter=3&type=0&keyword='
export const TURNSTILE_KEY = '0x4AAAAAAAETUSAKbds019h0'
@@ -9,3 +10,4 @@ export const USER_API_URL = `${BASE_API}user/`
export const ACCOUNT_API_URL = `${BASE_API}account/`
export const BILI_API_URL = `${BASE_API}bili/`
export const SONG_API_URL = `${BASE_API}song-list/`
export const NOTIFACTION_API_URL = `${BASE_API}notifaction/`

24
src/data/notifactions.ts Normal file
View 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()
}
}