From bde6c77f1170c3404c7e7f88b5aff8cef60178d8 Mon Sep 17 00:00:00 2001 From: aiyimickey <39365912+aiyimickey@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:03:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20#21=20login-page.tsx=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20localadmin=20hidden=20=E5=85=A5=E5=8F=A3=20(=3Fmeth?= =?UTF-8?q?od=3Dlocal)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/login-page.tsx | 50 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) 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