mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-08 17:32:27 +08:00
fix: v4 undefined problem
This commit is contained in:
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -23,5 +23,10 @@
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "vscode.json-language-features"
|
||||
}
|
||||
},
|
||||
"i18n-ally.localesPaths": [
|
||||
"i18n",
|
||||
"i18n/lang",
|
||||
"app/api/messages"
|
||||
]
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
import { type NextRequest } from 'next/server'
|
||||
import { APP_ID, API_KEY } from '@/config'
|
||||
import { ChatClient } from 'langgenius-client'
|
||||
import uuid from 'uuid'
|
||||
import { v4 } from 'uuid'
|
||||
|
||||
const userPrefix = `user_${APP_ID}:`;
|
||||
|
||||
export const getInfo = (request: NextRequest) => {
|
||||
const sessionId = request.cookies.get('session_id')?.value || uuid.v4();
|
||||
const sessionId = request.cookies.get('session_id')?.value || v4();
|
||||
const user = userPrefix + sessionId;
|
||||
return {
|
||||
sessionId,
|
||||
|
||||
Reference in New Issue
Block a user