mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-01 18:15:25 +08:00
13 lines
420 B
TypeScript
13 lines
420 B
TypeScript
import { fetchUserAccount, fetchUserAccountResponse } from '@/api/user'
|
|
import { UserApiNames } from '@/api/user'
|
|
|
|
export default function useUser() {
|
|
return useQuery(UserApiNames.FETCH_USER_ACCOUNT, fetchUserAccount, {
|
|
refetchOnWindowFocus: true,
|
|
placeholderData: (): fetchUserAccountResponse | undefined =>
|
|
window.ipcRenderer.sendSync('getApiCacheSync', {
|
|
api: 'user/account',
|
|
}),
|
|
})
|
|
}
|