同步处理

This commit is contained in:
tianmo committed 2026-10-17 18:15:42 +08:00
1 parent 9939943e31
commit 6494ad2918
26 files changed
+970 -40

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { getQuery } from 'h3'
import { requireSiteSyncAuth } from '../../utils/access'
import { createApiError } from '../../utils/api-error'
import { validateStorageKey } from '../../utils/image-key'
import { getSiteSyncChunkStatus } from '../../utils/site-sync/chunks'
export default defineEventHandler(async (event) => {
await requireSiteSyncAuth(event)
const query = getQuery(event)
const jobId = typeof query.jobId === 'string' ? query.jobId.trim() : ''
const key = typeof query.key === 'string' ? query.key.trim() : ''
if (!jobId || !validateStorageKey(key)) {
createApiError(event, 'INVALID_REQUEST', '分块查询参数无效', 400)
}
return getSiteSyncChunkStatus({ jobId, key })
})