mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-06-22 09:48:36 +00:00
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user