This commit is contained in:
parent
e977c98618
commit
120e670732
|
|
@ -62,7 +62,14 @@ export default async function Login({
|
|||
}
|
||||
|
||||
console.log("1======>Redirecting to workspace:", homeWorkspace.id)
|
||||
return redirect(`${localeString}/${homeWorkspace.id}/chat`)
|
||||
//return redirect(`${localeString}/${homeWorkspace.id}/chat`)
|
||||
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(redirect(`${localeString}/${homeWorkspace.id}/chat`))
|
||||
}, 6000) // 延时 6 秒,调整为你需要的时间
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
const signIn = async (formData: FormData) => {
|
||||
|
|
@ -79,7 +86,7 @@ export default async function Login({
|
|||
})
|
||||
|
||||
if (error) {
|
||||
return redirect(`${localeString}/login?message=${error.message}`)
|
||||
return redirect(`${localeString}/login?message=${error.message}`)
|
||||
}
|
||||
|
||||
const { data: homeWorkspace, error: homeWorkspaceError } = await supabase
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export function LanguageSwitcher() {
|
|||
}
|
||||
}
|
||||
else{
|
||||
console.log('language switcher no running in client browser.')
|
||||
console.log('language switcher noi running in server.')
|
||||
}
|
||||
}, [currentLocale])
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,12 @@ export default function HomeRedirector() {
|
|||
if (!hasLocaleInPath) {
|
||||
const newPath = `/${preferred}${currentPath}`
|
||||
console.log('......[HomeRedirector] Redirecting to:', newPath)
|
||||
router.replace(newPath)
|
||||
|
||||
// 添加延迟跳转,延迟时间为 2 秒(2000 毫秒)
|
||||
setTimeout(() => {
|
||||
router.replace(newPath)
|
||||
}, 2000) // 这里的 2000 毫秒是 2 秒的延时,你可以根据需要调整
|
||||
|
||||
} else {
|
||||
console.log('......[HomeRedirector] Already has valid locale in path, skipping redirect.')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue