fix: crypto undefined on some websites, leading to session creation failure (#231)

This commit is contained in:
josc146
2023-04-20 22:12:08 +08:00
parent 8af03398d5
commit 4fb5d735ea
6 changed files with 24 additions and 9 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { Models } from '../config/index.mjs'
import { v4 as uuidv4 } from 'uuid'
/**
* @typedef {object} Session
@@ -43,7 +44,7 @@ export function initSession({
conversationRecords,
sessionName,
sessionId: crypto.randomUUID(),
sessionId: uuidv4(),
aiName: modelName ? Models[modelName].desc : null,
modelName,