数据结构优化

This commit is contained in:
李琦
2026-01-20 15:23:37 +08:00
parent 946855bff2
commit cdbd3dc038
14 changed files with 835 additions and 198 deletions

View File

@@ -147,6 +147,7 @@ export interface OperationLog {
region?: string
path: string
method: string
action?: string
params: string
status: number
duration: number
@@ -1157,8 +1158,18 @@ export const getAccessLogs = async (page: number = 1, pageSize: number = 10): Pr
}
}
// 文章访问记录类型(来自 user_access_logs 表)
export interface PostAccessLog {
id: number
userId: number
ip: string
region: string
articleId: number
createdAt: string
}
// 获取指定文章的访问记录
export const getPostAccessLogs = async (postId: number, page: number = 1, pageSize: number = 20): Promise<PaginationResponse<AccessLog>> => {
export const getPostAccessLogs = async (postId: number, page: number = 1, pageSize: number = 20): Promise<PaginationResponse<PostAccessLog>> => {
try {
const response = await fetch(`${API_BASE}/admin/posts/${postId}/access-logs?page=${page}&pageSize=${pageSize}`, {
headers: getAuthHeaders()