数据结构优化
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user