diff --git a/ui/login-page.tsx b/ui/login-page.tsx index 19543dd..f9d2b72 100644 --- a/ui/login-page.tsx +++ b/ui/login-page.tsx @@ -1,6 +1,7 @@ 'use client' -// shared/ui/login-page.tsx — 统一登录页组件(与 issue-ai 登录页风格一致) -import { useState } from 'react' +// shared/ui/login-page.tsx — 统一登录页组件 +// 支持 SSO、LDAP 和 localadmin(通过 ?method=local URL 参数激活)三种登录方式 +import { useState, useEffect } from 'react' interface LoginPageProps { siteName: string // 站点名称,如 "IT 工单跟踪系统"、"告警监控中心" @@ -14,6 +15,12 @@ export default function LoginPage({ siteName, title, redirectPath = '/' }: Login const [error, setError] = useState('') const [loading, setLoading] = useState(false) const [showLdapForm, setShowLdapForm] = useState(false) + const [showLocalAdmin, setShowLocalAdmin] = useState(false) + + useEffect(() => { + const params = new URLSearchParams(window.location.search) + if (params.get('method') === 'local') setShowLocalAdmin(true) + }, []) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setLoading(true) @@ -47,7 +54,7 @@ export default function LoginPage({ siteName, title, redirectPath = '/' }: Login
{error}
)} - {!showLdapForm ? ( + {!showLdapForm && !showLocalAdmin ? ( <> + +

+ +

+ ) : ( <>