增加了版本号系统

This commit is contained in:
yml2213
2026-06-25 09:38:54 +08:00
parent f21f82cbed
commit e94b37c602
9 changed files with 131 additions and 22 deletions
+13 -1
View File
@@ -6,13 +6,16 @@ import { authApi } from '../api/modules';
import { setAuth, type AuthUser } from '../store/auth';
import { getErrorMessage } from '../utils/error';
import { useTheme } from '../store/useTheme';
import { useAppInfo } from '../hooks/useAppInfo';
const { Title } = Typography;
const { Title, Text } = Typography;
export default function LoginPage({ onLogin }: { onLogin?: () => void }) {
const [loading, setLoading] = useState(false);
const navigate = useNavigate();
const { isDark } = useTheme();
const appInfo = useAppInfo();
const versionText = appInfo?.version ? `v${appInfo.version}` : 'v--';
const onFinish = async (values: { username: string; password: string }) => {
setLoading(true);
@@ -49,6 +52,15 @@ export default function LoginPage({ onLogin }: { onLogin?: () => void }) {
<Title level={3} style={{ textAlign: 'center', marginBottom: 32 }}>
</Title>
<Text type="secondary" style={{
display: 'block',
textAlign: 'center',
marginTop: -20,
marginBottom: 24,
fontSize: 12,
}}>
{versionText}
</Text>
<Form onFinish={onFinish} size="large">
<Form.Item name="username" rules={[{ required: true, message: '请输入用户名' }]}>
<Input prefix={<UserOutlined />} placeholder="用户名" />