-- 设备唯一键 UNIQUE(uuid) → UNIQUE(user_id, uuid)(F3:同机换账号 403 死结) -- -- device_id 是客户端按「安装」生成并持久的,跨账号复用;全局 UNIQUE(uuid) 使同一台 -- 机器登第二个账号时 RegisterIfAbsent 永远 403。改为按用户隔离:同一物理设备在每个 -- 账号下各有一行。顺手给 platform ENUM 加 linux(normalizePlatform 已接受,列会拒)。 -- MySQL 可原地 ALTER,无需重建(列级 UNIQUE 的隐式索引名 = 列名 uuid)。 ALTER TABLE devices DROP INDEX uuid, ADD UNIQUE KEY uniq_devices_user_uuid (user_id, uuid), MODIFY platform ENUM('ios','android','windows','macos','linux') NOT NULL;