feat: make account password login explicit
This commit is contained in:
@@ -94,7 +94,8 @@ test('exposes only account and password login on the public sign-in screen', asy
|
||||
|
||||
render(<QueryClientProvider client={client}><AuthGate><ProtectedWorkspace onAbort={() => undefined} /></AuthGate></QueryClientProvider>);
|
||||
|
||||
expect(await screen.findByRole('form', { name: '平台账号登录' })).toBeInTheDocument();
|
||||
expect(await screen.findByRole('form', { name: '账号密码登录' })).toBeInTheDocument();
|
||||
expect(screen.getByText('使用管理员为你开通的账号和密码登录。')).toBeInTheDocument();
|
||||
expect(screen.getByPlaceholderText('请输入用户名')).toHaveAttribute('autocomplete', 'username');
|
||||
expect(screen.getByPlaceholderText('请输入密码')).toHaveAttribute('autocomplete', 'current-password');
|
||||
expect(screen.queryByRole('tab')).not.toBeInTheDocument();
|
||||
|
||||
@@ -147,12 +147,12 @@ export function AuthGate({ children }: { children: ReactNode }) {
|
||||
<footer><IconLock /><Text>账号、车辆与菜单权限全程隔离</Text></footer>
|
||||
</section>
|
||||
<Card className="v2-auth-card" bodyStyle={{ padding: 0 }}>
|
||||
<form className="v2-auth-form" onSubmit={login} aria-label="平台账号登录">
|
||||
<form className="v2-auth-form" onSubmit={login} aria-label="账号密码登录">
|
||||
<header className="v2-auth-form-heading">
|
||||
<img className="v2-auth-logo" src="/brand-logo.svg" alt="羚牛智能" />
|
||||
<Tag color="blue" prefixIcon={<IconUser />}>账号权限登录</Tag>
|
||||
<Tag color="blue" prefixIcon={<IconUser />}>账号密码登录</Tag>
|
||||
<Title heading={3}>登录车辆数据中台</Title>
|
||||
<Text type="secondary">使用管理员为你开通的账号登录。</Text>
|
||||
<Text type="secondary">使用管理员为你开通的账号和密码登录。</Text>
|
||||
</header>
|
||||
<div className="v2-auth-fields">
|
||||
<label><span>用户名</span><Input autoFocus required autoComplete="username" prefix={<IconUser aria-hidden="true" />} value={username} onChange={setUsername} placeholder="请输入用户名" size="large" /></label>
|
||||
|
||||
@@ -653,6 +653,8 @@ describe('V2 production entry', () => {
|
||||
expect(authGateSource.match(/<PasswordInput/g)).toHaveLength(1);
|
||||
expect(authGateSource).not.toContain('<Tabs');
|
||||
expect(authGateSource).not.toContain('运维令牌');
|
||||
expect(authGateSource).toContain('aria-label="账号密码登录"');
|
||||
expect(authGateSource).toContain('>账号密码登录</Tag>');
|
||||
expect(passwordInputSource).toContain('<Input');
|
||||
expect(passwordInputSource).toContain('<Button');
|
||||
expect(passwordInputSource).toContain("`${visible ? '隐藏' : '显示'}${visibilityLabel}`");
|
||||
|
||||
@@ -5754,7 +5754,7 @@
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* Semi UI identity workspace: one explicit account and operations entry system. */
|
||||
/* Semi UI identity workspace: one explicit account-and-password entry system. */
|
||||
.v2-auth-screen:not(.is-session-loading) {
|
||||
grid-template-columns: minmax(430px, 1.12fr) minmax(420px, 460px);
|
||||
column-gap: clamp(34px, 5vw, 82px);
|
||||
|
||||
Reference in New Issue
Block a user