commit
4c6e056261
2 changed files with 2 additions and 4 deletions
|
@ -429,7 +429,7 @@ const ChatWindow = ({id}: { id?: string }) => {
|
|||
setUserId(storedUserId);
|
||||
console.debug('Using existing user ID:', storedUserId);
|
||||
} else {
|
||||
const newUserId = new Mcid().generate().toString(); // 转换为字符串
|
||||
const newUserId = new Mcid().generate().toString();
|
||||
|
||||
localStorage.setItem('userId', newUserId);
|
||||
setUserId(newUserId);
|
||||
|
|
|
@ -30,9 +30,7 @@ export class Mcid {
|
|||
this.lastTimestamp = now;
|
||||
|
||||
return (
|
||||
(now * 0x1000) + // 时间戳左移 12 位
|
||||
(this.machineId * 16) + // 机器 ID 左移 4 位
|
||||
this.sequence // 序列号
|
||||
(now * 0x1000) + (this.machineId * 16) + this.sequence
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue