From c0af42f817ecd7ba0e98b09cd3c40f63a6ae705a Mon Sep 17 00:00:00 2001 From: Austin Lee Date: Sun, 25 Aug 2024 09:21:31 +0800 Subject: [PATCH] fix: fix #2619 (#2688) --- packages/server/src/logic/comment.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/server/src/logic/comment.js b/packages/server/src/logic/comment.js index 156a0ede0ed..b3f9d4d4c90 100644 --- a/packages/server/src/logic/comment.js +++ b/packages/server/src/logic/comment.js @@ -249,17 +249,10 @@ module.exports = class extends Base { */ async putAction() { const { userInfo } = this.ctx.state; - const { like } = this.post(); - - // 1. like - if (think.isEmpty(userInfo) && think.isBoolean(like)) { - this.rules = { - like: { - required: true, - boolean: true, - }, - }; + const data = this.post(); + // 1. like action + if (think.isBoolean(data.like) && Object.keys(data).toString() === 'like') { return; }