update:更新登录页面,添加默认登录名密码提示。

This commit is contained in:
xiamuceer-j
2026-03-04 16:24:58 +08:00
parent 4af79e290b
commit ca75ec1a0a
2 changed files with 118 additions and 6 deletions
+22 -4
View File
@@ -16,6 +16,7 @@ export default function Login() {
const [linuxdoEnabled, setLinuxdoEnabled] = useState(false);
const [form] = Form.useForm();
const [showAnnouncement, setShowAnnouncement] = useState(false);
const [activeLoginMethod, setActiveLoginMethod] = useState<'local' | 'linuxdo'>('local');
// 检查是否已登录和获取认证配置
useEffect(() => {
@@ -215,6 +216,12 @@ export default function Login() {
localStorage.setItem('announcement_hide_forever', 'true');
};
const currentLoginMethod = localAuthEnabled && linuxdoEnabled
? activeLoginMethod
: localAuthEnabled
? 'local'
: 'linuxdo';
return (
<>
<AnnouncementModal
@@ -319,7 +326,8 @@ export default function Login() {
{/* 登录方式 */}
{localAuthEnabled && linuxdoEnabled ? (
<Tabs
defaultActiveKey="local"
activeKey={activeLoginMethod}
onChange={(key) => setActiveLoginMethod(key as 'local' | 'linuxdo')}
centered
items={[
{
@@ -353,9 +361,19 @@ export default function Login() {
marginBottom: 0,
lineHeight: 1.6,
}}>
🎉
<br />
🔒
{currentLoginMethod === 'linuxdo' ? (
<>
🎉
<br />
🔒
</>
) : (
<>
🧪 admin / admin123
<br />
🔒
</>
)}
</Paragraph>
</div>
</Space>