feat: decode uid

This commit is contained in:
liuyuanchuang
2026-01-27 22:28:13 +08:00
parent be3e82fc2e
commit 41df42dea4

View File

@@ -37,12 +37,7 @@ func (h *AnalyticsHandler) TrackEvent(c *gin.Context) {
return return
} }
userID, err := common.GetUserIDFromContext(c) userID := common.GetUserIDFromContext(c)
if err != nil {
log.Error(c.Request.Context(), "get user id failed", "error", err)
c.JSON(http.StatusOK, common.ErrorResponse(c, common.CodeUnauthorized, "unauthorized"))
return
}
req.UserID = userID req.UserID = userID
if err := h.analyticsService.TrackEvent(c.Request.Context(), &req); err != nil { if err := h.analyticsService.TrackEvent(c.Request.Context(), &req); err != nil {