mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 23:26:38 +08:00
refactor(frontend): colocate admin components and split service layer
Move route-specific admin components from components/common/admin into app/(main)/admin/<feature>/components/. Split AdminService god object into domain services, fix UploadService to use BaseService, add AdminUploadService, consolidate DB export into DbManageService, and migrate consumers to the unified services entry.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {useQuery} from '@tanstack/react-query'
|
||||
import {ConfigService} from '@/lib/services/config'
|
||||
import services from '@/lib/services'
|
||||
|
||||
/**
|
||||
* 获取公共配置(使用 React Query 进行统一缓存与自动同步)
|
||||
@@ -12,7 +12,7 @@ import {ConfigService} from '@/lib/services/config'
|
||||
export function usePublicConfig() {
|
||||
const { data: config, isLoading: loading, error } = useQuery({
|
||||
queryKey: ['public-config'],
|
||||
queryFn: () => ConfigService.getPublicConfig(),
|
||||
queryFn: () => services.config.getPublicConfig(),
|
||||
staleTime: 5 * 60 * 1000, // 5 分钟缓存
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user