数据结构优化

This commit is contained in:
李琦
2026-01-20 11:12:01 +08:00
parent b088ba48be
commit 4aa757082b
9 changed files with 519 additions and 51 deletions

View File

@@ -1083,6 +1083,30 @@ export const deleteSetting = async (keyName: string): Promise<void> => {
}
}
// 公开设置API前端使用无需认证
export interface PublicSettings {
site_title?: string
site_description?: string
site_author?: string
site_keywords?: string
}
export const getPublicSettings = async (): Promise<PublicSettings> => {
try {
const response = await fetch(`${API_BASE}/settings`)
if (!response.ok) {
const errorData = await response.json()
throw new Error(errorData.message || '获取网站配置失败')
}
const data = await response.json()
return data.result || {}
} catch (error) {
console.error('Get public settings error:', error)
// 返回空对象,前端使用默认值
return {}
}
}
// 操作日志API
export const getOperationLogs = async (page: number = 1, pageSize: number = 10): Promise<PaginationResponse<OperationLog>> => {
try {