fix: don't record log if staff

This commit is contained in:
ericprd
2025-03-20 11:19:41 +08:00
parent d8f6968f64
commit 0c8133c802
+4 -2
View File
@@ -34,12 +34,13 @@ func GetBySlug(
return
}
userDetail, _ := utils.GetTokenDetail(r)
if userDetail.Role != "staff" {
var specReq logsdomain.LogsSpec
specReq.ContentID = news.ID
userDetail, _ := utils.GetTokenDetail(r)
if userDetail.ID != "" {
specReq.UserID = &userDetail.ID
}
@@ -69,6 +70,7 @@ func GetBySlug(
)
return
}
}
response.RespondJsonSuccess(ctx, w, news)
})