diff --git a/src/views/App.jsx b/src/views/App.jsx index 2ef5bce..0ff7fa7 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -5,7 +5,6 @@ import { DownOutlined } from '@ant-design/icons'; import 'antd/dist/reset.css'; import AppLogo from '@/assets/logo-gh.png'; import { isEmpty } from '@/utils/commons'; -import Language from '../i18n/LanguageSwitcher'; import { useTranslation } from 'react-i18next'; import zhLocale from 'antd/locale/zh_CN'; import enLocale from 'antd/locale/en_US'; @@ -158,9 +157,6 @@ function App() { - - - diff --git a/src/views/Login.jsx b/src/views/Login.jsx index 5c1ee55..a8bcc71 100644 --- a/src/views/Login.jsx +++ b/src/views/Login.jsx @@ -1,18 +1,21 @@ import { useNavigate } from 'react-router-dom' import { useEffect } from 'react' -import { Button, Form, Input, Row, App } from 'antd' +import { Button, Form, Input, Row, Radio, App } from 'antd' import { useTranslation } from 'react-i18next' import useAuthStore from '@/stores/Auth' +import { appendRequestParams } from '@/utils/request' function Login() { const [authenticate, loginStatus, defaultRoute] = useAuthStore((state) => [state.authenticate, state.loginStatus, state.defaultRoute]) - const { t } = useTranslation() + const { t, i18n } = useTranslation() const { notification } = App.useApp() const navigate = useNavigate() const [form] = Form.useForm() + const defaultLng = localStorage.getItem('i18nextLng')??'zh' + useEffect (() => { if (loginStatus === 302) { navigate(defaultRoute) @@ -36,6 +39,11 @@ function Login() { console.log('Failed:', errorInfo); } + const handleLngChange = (e) => { + appendRequestParams('lgc', e.target.value === 'zh' ? 2 : 1) + i18n.changeLanguage(e.target.value) + } + return (
- + + + 中文 + English + + + diff --git a/src/views/Standlone.jsx b/src/views/Standlone.jsx index 6ce6113..7b80efa 100644 --- a/src/views/Standlone.jsx +++ b/src/views/Standlone.jsx @@ -28,9 +28,6 @@ function Standlone() { App logo

Global Highlights Hub

- - -