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
This commit is contained in:
copilot-swe-agent[bot] 2026-03-26 12:34:31 +00:00 committed by GitHub
parent 700c6188b1
commit d67f141425
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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 + ' 已有对应的宝宝人格体,一个人类只能对应唯一一个' };