This commit is contained in:
hailin 2025-04-19 15:13:20 +08:00
parent 65c3719707
commit 379313dde9
1 changed files with 7 additions and 1 deletions

View File

@ -22,9 +22,15 @@ import {
validateChatSettings
} from "../chat-helpers"
import { usePathname } from "next/navigation"
export const useChatHandler = () => {
const pathname = usePathname() // 获取当前路径
const router = useRouter()
// 提取当前路径中的 locale 部分
const locale = pathname.split("/")[1] || "en"
const {
userInput,
chatFiles,
@ -175,7 +181,7 @@ export const useChatHandler = () => {
// })
}
return router.push(`/${selectedWorkspace.id}/chat`)
return router.push(`/${locale}/${selectedWorkspace.id}/chat`)
}
const handleFocusChatInput = () => {