fix version 1

This commit is contained in:
2026-09-22 21:15:34 +08:00
parent 9f86366638
commit d63d7e8b3a
277 changed files with 9959 additions and 1514 deletions

View File

@@ -22,6 +22,11 @@ func Action(ctx context.Context, in *pb.PostActionRequest) (reply *pb.DataStatus
if in.GetActionOp() == "" || in.GetActionType() == "" || in.GetIdentity() == "" {
return nil, errcode.ErrInvalidArgument
}
// 白名单校验,避免非法操作/类别拼出空列名或未绑定目标表的更新语句
if (in.ActionOp != "ilike" && in.ActionOp != "unlike") ||
(in.ActionType != "post" && in.ActionType != "comment") {
return nil, errcode.ErrInvalidArgument
}
if err := models.LikeAction(in.ActionOp, in.ActionType, in.Identity); err != nil {
printer.Error(err.Error())
return nil, err