Skip to content

Commit bfa76ce

Browse files
author
heheer
committed
fix
1 parent 1a3bc92 commit bfa76ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

projects/fastgpt/components/header/LangSwitcher.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export const LangSwitcher = () => {
2020

2121
const handleSwitchLanguage = (value: string) => {
2222
localStorage.setItem('preferredLang', value);
23-
if (value === defaultLocale) {
23+
if (value === 'zh') {
24+
router.push('https://fastgpt.cn/');
25+
return;
26+
}else if (value === defaultLocale) {
2427
router.push('/');
2528
return;
2629
}
@@ -32,7 +35,7 @@ export const LangSwitcher = () => {
3235
if (storedLang && storedLang !== lang && storedLang !== defaultLocale) {
3336
router.push(storedLang);
3437
}
35-
}, [lang, router]);
38+
}, []);
3639

3740
return (
3841
<Select value={langName} onValueChange={handleSwitchLanguage}>

0 commit comments

Comments
 (0)