This commit is contained in:
parent
60ca9d8bd3
commit
b22645415b
|
|
@ -26,11 +26,13 @@ export default async function Login({
|
|||
const cookieStore = cookies()
|
||||
|
||||
// 优先从 cookie 获取 locale,否则使用 URL 参数中的 locale
|
||||
const localeString = cookieStore.get('locale')?.value || locale;
|
||||
//const localeString = cookieStore.get('locale')?.value || locale;
|
||||
|
||||
const localeString = locale;
|
||||
|
||||
const { t, resources } = await initTranslations(localeString, ['translation']);
|
||||
// 打印翻译内容确认是否正常加载
|
||||
console.log("...............locale: ", {localeString});
|
||||
console.log("...............localeString: ", {localeString});
|
||||
console.log("Translation for login.email: ", t("login.email"));
|
||||
|
||||
|
||||
|
|
@ -60,7 +62,7 @@ export default async function Login({
|
|||
}
|
||||
|
||||
console.log("1======>Redirecting to workspace:", homeWorkspace.id)
|
||||
return redirect(`/${homeWorkspace.id}/chat`)
|
||||
return redirect(`${localeString}/${homeWorkspace.id}/chat`)
|
||||
}
|
||||
|
||||
const signIn = async (formData: FormData) => {
|
||||
|
|
@ -77,7 +79,7 @@ export default async function Login({
|
|||
})
|
||||
|
||||
if (error) {
|
||||
return redirect(`/login?message=${error.message}`)
|
||||
return redirect(`${localeString}/login?message=${error.message}`)
|
||||
}
|
||||
|
||||
const { data: homeWorkspace, error: homeWorkspaceError } = await supabase
|
||||
|
|
@ -94,7 +96,7 @@ export default async function Login({
|
|||
}
|
||||
|
||||
console.log("2======>Redirecting to workspace:", homeWorkspace.id)
|
||||
return redirect(`${locale}/${homeWorkspace.id}/chat`)
|
||||
return redirect(`${localeString}/${homeWorkspace.id}/chat`)
|
||||
}
|
||||
|
||||
const getEnvVarOrEdgeConfigValue = async (name: string) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue