0.0.3.0
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
module.exports=[12576,(a,b,c)=>{"use strict";b.exports=a.r(81232).vendored["react-ssr"].ReactServerDOMTurbopackClient},27532,a=>{"use strict";var b=a.i(6155),c=a.i(54297),d=a.i(1845),e=a.i(14672),f=a.i(31483),g=a.i(8895),h=a.i(59580),i=a.i(85801),j=a.i(99766),k=a.i(24749),l=a.i(38076);function m(){(0,e.useRouter)();let[a,m]=(0,c.useState)("wang@example.com"),[n,o]=(0,c.useState)("123456"),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(!1),t=async b=>{b.preventDefault(),q(""),s(!0);try{await (0,d.signOut)({redirect:!1}),await new Promise(a=>setTimeout(a,500)),localStorage.clear(),sessionStorage.clear();let b=await (0,d.signIn)("credentials",{email:a,password:n,redirect:!1});b?.error?(q("邮箱或密码错误"),s(!1)):window.location.replace("/")}catch(a){q("登录失败,请稍后重试"),s(!1)}};return(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4",children:(0,b.jsxs)(j.Card,{className:"w-full max-w-md",children:[(0,b.jsxs)(j.CardHeader,{className:"space-y-1 text-center",children:[(0,b.jsx)("div",{className:"flex justify-center mb-4",children:(0,b.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:(0,b.jsx)(l.BookOpen,{className:"h-7 w-7"})})}),(0,b.jsx)(j.CardTitle,{className:"text-2xl font-serif",children:"登录"}),(0,b.jsx)(j.CardDescription,{children:"登录到华夏谱家族树系统"})]}),(0,b.jsxs)("form",{onSubmit:t,children:[(0,b.jsxs)(j.CardContent,{className:"space-y-4",children:[p&&(0,b.jsx)(k.Alert,{variant:"destructive",children:(0,b.jsx)(k.AlertDescription,{children:p})}),(0,b.jsx)(k.Alert,{className:"bg-blue-50 border-blue-200 dark:bg-blue-950 dark:border-blue-800",children:(0,b.jsx)(k.AlertDescription,{className:"text-sm text-blue-800 dark:text-blue-200",children:(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("div",{className:"font-semibold",children:"💡 测试账号:"}),(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{children:"王先生: wang@example.com / 123456"}),(0,b.jsx)(g.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>{m("wang@example.com"),o("123456")},children:"使用"})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{children:"虞女士: yu@example.com / 123456"}),(0,b.jsx)(g.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>{m("yu@example.com"),o("123456")},children:"使用"})]})]})]})})}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Label,{htmlFor:"email",children:"邮箱"}),(0,b.jsx)(h.Input,{id:"email",type:"email",placeholder:"your@email.com",value:a,onChange:a=>m(a.target.value),required:!0,disabled:r})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Label,{htmlFor:"password",children:"密码"}),(0,b.jsx)(h.Input,{id:"password",type:"password",placeholder:"••••••••",value:n,onChange:a=>o(a.target.value),required:!0,disabled:r})]})]}),(0,b.jsxs)(j.CardFooter,{className:"flex flex-col space-y-4",children:[(0,b.jsx)(g.Button,{type:"submit",className:"w-full",disabled:r,children:r?"登录中...":"登录"}),(0,b.jsxs)("div",{className:"text-sm text-center text-muted-foreground",children:["还没有账号?"," ",(0,b.jsx)(f.default,{href:"/auth/register",className:"text-primary hover:underline",children:"立即注册"})]})]})]})]})})}a.s(["default",()=>m])}];
|
||||
|
||||
//# sourceMappingURL=Documents_go-new_chinese-family-tree_e4bc167c._.js.map
|
||||
Reference in New Issue
Block a user