拆分前端后台管理 API 客户端

This commit is contained in:
yml
2026-05-04 09:55:27 +08:00
parent 66261e56d1
commit 8e1a4be895
13 changed files with 631 additions and 617 deletions
+14
View File
@@ -0,0 +1,14 @@
import { apiGet, apiPost } from '@/lib/http'
import type { AdminLoginResponse, AdminSessionSummary } from '@/types/admin'
export function loginAdmin(payload: { username: string; password: string }) {
return apiPost<AdminLoginResponse>('/api/v1/admin/auth/login', payload)
}
export function fetchAdminSession() {
return apiGet<AdminSessionSummary>('/api/v1/admin/auth/session')
}
export function logoutAdmin() {
return apiPost<{ success: boolean }>('/api/v1/admin/auth/logout', {})
}