This commit is contained in:
parent
a63d9afd66
commit
38e095d61b
|
|
@ -190,16 +190,19 @@ export const useChatHandler = () => {
|
||||||
const defaultLocale = i18nConfig.defaultLocale
|
const defaultLocale = i18nConfig.defaultLocale
|
||||||
|
|
||||||
let locale: (typeof locales)[number] = defaultLocale
|
let locale: (typeof locales)[number] = defaultLocale
|
||||||
|
|
||||||
const segment = pathSegments[0] as (typeof locales)[number]
|
const segment = pathSegments[0] as (typeof locales)[number]
|
||||||
|
|
||||||
if (locales.includes(segment)) {
|
if (locales.includes(segment)) {
|
||||||
locale = segment
|
locale = segment
|
||||||
}
|
}
|
||||||
const homePath = locale === defaultLocale ? "/" : `${locale}`
|
|
||||||
|
|
||||||
console.log("[use-chat-handler.tsx]...........homePath",homePath)
|
// ✅ 正确构造 localePrefix,不包含前导 /
|
||||||
return router.push(`/${homePath}/${selectedWorkspace.id}/chat`)
|
const localePrefix = locale === defaultLocale ? "" : `/${locale}`
|
||||||
|
|
||||||
|
console.log("[use-chat-handler.tsx]...........localePrefix", localePrefix)
|
||||||
|
|
||||||
|
console.log("[use-chat-handler.tsx]...........homePath",localePrefix)
|
||||||
|
return router.push(`${localePrefix}/${selectedWorkspace.id}/chat`)
|
||||||
|
|
||||||
// return router.push(`/${locale}/${selectedWorkspace.id}/chat`)
|
// return router.push(`/${locale}/${selectedWorkspace.id}/chat`)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue