fix(backend): license/info 返回 phase 字段,前端横幅/弹窗依赖此字段

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-10 09:30:25 +08:00
parent 13fc9b7aaf
commit bc85b2c8ad
+9 -1
View File
@@ -60,7 +60,15 @@ func (h *LicenseHandler) Info(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"data": nil})
return
}
c.JSON(http.StatusOK, gin.H{"data": lic})
phase := middleware.CalcLicensePhase(lic.ExpiresAt)
c.JSON(http.StatusOK, gin.H{"data": gin.H{
"id": lic.ID,
"type": lic.Type,
"is_active": lic.IsActive,
"max_devices": lic.MaxDevices,
"expires_at": lic.ExpiresAt,
"phase": phase,
}})
}
// Deactivate POST /api/v1/license/deactivate