修复同步状态接口返回格式导致前端崩溃

This commit is contained in:
2026-07-04 12:21:35 +08:00
parent d497eb7f96
commit 2a8acd7362
2 changed files with 2 additions and 5 deletions
+1 -5
View File
@@ -139,11 +139,7 @@ func (h *StockHandler) SyncStatus(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": "查询同步状态失败"})
return
}
if job == nil {
c.JSON(http.StatusOK, gin.H{"success": true, "data": nil})
return
}
c.JSON(http.StatusOK, gin.H{"success": true, "data": job})
c.JSON(http.StatusOK, job)
}
// TriggerSync 手动触发同步(管理员)。