feat(identity): 收敛 AI Gateway 统一认证入口
Web 登录页合并为单一统一认证入口,未指定上下文时由认证中心在登录后决策。继续接受旧客户端显式传入 platform 或 tenant,并保持回调上下文及 tenant_hint 的绑定校验。同步更新 OpenAPI 产物。\n\n验证:Go 全量测试与 go vet 通过;Web lint、141 项 Vitest 和生产构建通过;本地 platform.admin 登录及管理工作台访问通过。
This commit is contained in:
@@ -2,7 +2,6 @@ import type { FormEvent } from 'react';
|
||||
import { LogIn, UserPlus } from 'lucide-react';
|
||||
import { Button, Card, CardContent, CardHeader, CardTitle, Input, Label, PasswordInput, Tabs } from './ui';
|
||||
import type { AuthMode, LoadState, LoginForm, RegisterForm } from '../types';
|
||||
import type { OIDCContextType } from '../lib/oidc';
|
||||
|
||||
const tabs = [
|
||||
{ value: 'login', label: '账号登录' },
|
||||
@@ -24,8 +23,7 @@ export function AuthPanel(props: {
|
||||
onSubmitLogin: (event: FormEvent<HTMLFormElement>) => void;
|
||||
onSubmitRegister: (event: FormEvent<HTMLFormElement>) => void;
|
||||
oidcEnabled: boolean;
|
||||
oidcContextTypes: readonly OIDCContextType[];
|
||||
onOIDCLogin: (contextType: OIDCContextType) => void;
|
||||
onOIDCLogin: () => void;
|
||||
}) {
|
||||
return (
|
||||
<section className="authShell" aria-label="登录">
|
||||
@@ -39,26 +37,14 @@ export function AuthPanel(props: {
|
||||
<CardContent className="authContent">
|
||||
{props.oidcEnabled ? (
|
||||
<div className="formGrid">
|
||||
{props.oidcContextTypes.includes('platform') && (
|
||||
<Button
|
||||
type="button"
|
||||
disabled={props.state === 'loading'}
|
||||
onClick={() => props.onOIDCLogin('platform')}
|
||||
>
|
||||
<LogIn size={15} />
|
||||
使用平台账号登录
|
||||
</Button>
|
||||
)}
|
||||
{props.oidcContextTypes.includes('tenant') && (
|
||||
<Button
|
||||
type="button"
|
||||
disabled={props.state === 'loading'}
|
||||
onClick={() => props.onOIDCLogin('tenant')}
|
||||
>
|
||||
<LogIn size={15} />
|
||||
使用租户账号登录
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
type="button"
|
||||
disabled={props.state === 'loading'}
|
||||
onClick={props.onOIDCLogin}
|
||||
>
|
||||
<LogIn size={15} />
|
||||
使用统一认证登录
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user