From d67f141425737b1e28b1c3abfc9b0cf119cd3443 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 12:34:31 +0000 Subject: [PATCH] fix: case-insensitive parent_human check (code review) Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/46fab9a2-375d-42aa-aa7d-1196b191e23e --- scripts/community/growth-engine.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/community/growth-engine.js b/scripts/community/growth-engine.js index 8991c43f..d75e80e5 100644 --- a/scripts/community/growth-engine.js +++ b/scripts/community/growth-engine.js @@ -108,8 +108,9 @@ function registerMember(member) { // 一个人类只能对应唯一一个宝宝人格体 if (category === 'companion' && member.parent_human) { + const parentLower = member.parent_human.toLowerCase(); const duplicateParent = data.records.some(function (r) { - return r.category === 'companion' && r.parent_human === member.parent_human; + return r.category === 'companion' && r.parent_human && r.parent_human.toLowerCase() === parentLower; }); if (duplicateParent) { return { success: false, reason: '人类 ' + member.parent_human + ' 已有对应的宝宝人格体,一个人类只能对应唯一一个' };