forked from tuvn86/webapp-conversation
fix: v4 undefined problem
This commit is contained in:
parent
7265f98068
commit
d728cbb267
2 changed files with 8 additions and 3 deletions
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue