深度优化 ui
This commit is contained in:
+17
-5
@@ -1,3 +1,5 @@
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SubmitButton } from "@/components/submit-button";
|
||||
import type { Metadata } from "next";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
@@ -41,18 +43,28 @@ export default async function LoginPage({
|
||||
<form action={loginAction} className="stack-lg login-form">
|
||||
<label className="field">
|
||||
<span>用户名</span>
|
||||
<input name="username" type="text" placeholder="admin" required />
|
||||
<Input
|
||||
name="username"
|
||||
autoComplete="username"
|
||||
autoFocus
|
||||
type="text"
|
||||
placeholder="admin"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<label className="field">
|
||||
<span>密码</span>
|
||||
<input name="password" type="password" required />
|
||||
<Input
|
||||
name="password"
|
||||
autoComplete="current-password"
|
||||
type="password"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
{params.error ? (
|
||||
<p className="error-banner">用户名或密码错误。</p>
|
||||
) : null}
|
||||
<button className="primary-button" type="submit">
|
||||
登录
|
||||
</button>
|
||||
<SubmitButton variant="default">登录</SubmitButton>
|
||||
</form>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user