diff --git a/.vscode/settings.json b/.vscode/settings.json index edbfba9..e35fdc6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -23,5 +23,10 @@ }, "[jsonc]": { "editor.defaultFormatter": "vscode.json-language-features" - } + }, + "i18n-ally.localesPaths": [ + "i18n", + "i18n/lang", + "app/api/messages" + ] } \ No newline at end of file diff --git a/app/api/utils/common.ts b/app/api/utils/common.ts index e276dfa..87fadcc 100644 --- a/app/api/utils/common.ts +++ b/app/api/utils/common.ts @@ -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,