selfrelease 6b3e1f9d46 fix: 手机号查重硬校验 + portal 登录跨组织安全
问题:
1. 后端 createEmployee 只有身份证查重,没有手机号查重,
   同组织内可重复录入相同手机号,导致员工端登录混乱
2. portal 登录用 findFirst 按 phone 查,未考虑跨组织重复,
   多组织同手机号时会登录到错误员工
3. Contracts.tsx 的 AddEmployeeModal 完全没有手机号查重

修复:
1. contract.service.ts createEmployee 添加手机号查重硬校验
   (同组织内 phone 唯一,抛 DUPLICATE_PHONE 错误)
2. portal.routes.ts 密码登录改为 findMany 遍历校验密码,
   验证码登录改为 findMany 取第一个匹配
3. Contracts.tsx AddEmployeeModal 添加手机号查重和警告提示

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-16 10:57:06 +08:00
2026-08-11 22:02:19 +08:00
S
Description
AI HR Compliance Assistant
13 MiB
Languages
TypeScript 88.6%
HTML 10.9%
Shell 0.3%
Python 0.1%