remove userId

This commit is contained in:
litongjava 2025-02-02 16:09:59 -10:00
parent 969f01e275
commit 5f672eaa66
2 changed files with 2 additions and 4 deletions

View file

@ -429,7 +429,7 @@ const ChatWindow = ({id}: { id?: string }) => {
setUserId(storedUserId); setUserId(storedUserId);
console.debug('Using existing user ID:', storedUserId); console.debug('Using existing user ID:', storedUserId);
} else { } else {
const newUserId = new Mcid().generate().toString(); // 转换为字符串 const newUserId = new Mcid().generate().toString();
localStorage.setItem('userId', newUserId); localStorage.setItem('userId', newUserId);
setUserId(newUserId); setUserId(newUserId);

View file

@ -30,9 +30,7 @@ export class Mcid {
this.lastTimestamp = now; this.lastTimestamp = now;
return ( return (
(now * 0x1000) + // 时间戳左移 12 位 (now * 0x1000) + (this.machineId * 16) + this.sequence
(this.machineId * 16) + // 机器 ID 左移 4 位
this.sequence // 序列号
); );
} }
} }