Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk committed Oct 31, 2024
1 parent 60feff9 commit a6fc3ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions projects/fastgpt/components/header/LangSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const LangSwitcher = () => {

const handleSwitchLanguage = (value: string) => {
localStorage.setItem('preferredLang', value);
if (value === defaultLocale) {
if (value === 'zh') {
router.push('https://fastgpt.cn/');
return;
}else if (value === defaultLocale) {
router.push('/');
return;
}
Expand All @@ -32,7 +35,7 @@ export const LangSwitcher = () => {
if (storedLang && storedLang !== lang && storedLang !== defaultLocale) {
router.push(storedLang);
}
}, [lang, router]);
}, []);

return (
<Select value={langName} onValueChange={handleSwitchLanguage}>
Expand Down

0 comments on commit a6fc3ea

Please sign in to comment.