抽取 randomUUID, crypto-browserify

This commit is contained in:
CrescentLeaf
2025-12-06 11:08:24 +08:00
parent d76abcf512
commit d433ceb4a9
7 changed files with 68 additions and 17 deletions

View File

@@ -3,7 +3,7 @@ import { io, ManagerOptions, Socket, SocketOptions } from 'socket.io-client'
import crypto from 'node:crypto'
import { CallMethod, ClientEvent, ClientEventCallback } from './ApiDeclare.ts'
import ApiCallbackMessage from './ApiCallbackMessage.ts'
import { CallableMethodBeforeAuth } from "lingchair-internal-shared"
import { CallableMethodBeforeAuth, randomUUID } from "lingchair-internal-shared"
import CallbackError from "./CallbackError.ts"
import Message from "./Message.ts"
@@ -36,7 +36,7 @@ export default class LingChairClient {
auth: {
...args.io?.auth,
device_id: this.device_id,
session_id: crypto.randomUUID(),
session_id: randomUUID(),
},
})
this.client.on("The_White_Silk", (name: ClientEvent, data: any, _callback: (ret: unknown) => void) => {