1
0

feat(frontend): 优化登陆页面样式

This commit is contained in:
2024-12-20 16:52:21 +08:00
parent 615edb57b8
commit 5a0c44ff35

View File

@@ -4,74 +4,103 @@ import {userRegisterDialog} from '../../components/user/dialog-user-register.js'
useAmis(information => { useAmis(information => {
return { return {
type: 'page', type: 'page',
title: information.title, className: 'h-screen bg-gray-900',
subTitle: '统一登陆入口', bodyClassName: 'h-full flex items-start mt-20',
body: [ body: [
{ {
type: 'grid', type: 'wrapper',
columns: [ className: 'relative w-full max-w-md mx-auto',
body: [
{ {
xs: 0, type: 'flex',
sm: 0, justify: 'center',
md: 4, className: 'mb-8',
body: [], items: [
{
type: 'avatar',
src: '/logo.svg',
shape: 'square',
size: 64,
fit: 'contain',
className: 'mr-4 bg-transparent'
},
{
type: 'flex',
direction: 'column',
justify: 'center',
items: [
{
type: 'tpl',
tpl: information.title,
className: 'text-2xl font-bold text-white'
},
{
type: 'tpl',
tpl: '统一登录入口',
className: 'text-lg ml-1 mt-1 text-gray-100'
}
]
}
]
}, },
{ {
xs: 12, type: 'form',
sm: 12, className: 'bg-white rounded-xl p-10 shadow-2xl',
md: 4, api: '${base}/user/login',
redirect: '/pages/index/index.html?token=${token}',
mode: 'normal',
wrapWithPanel: false,
body: [ body: [
{ {
type: 'form', type: 'input-email',
title: '用户登陆', name: 'username',
api: '${base}/user/login', label: false,
redirect: '/pages/index/index.html?token=${token}', placeholder: '请输入邮箱',
mode: 'horizontal', required: true,
horizontal: { clearable: true,
left: 2, className: 'mb-4',
}, inputClassName: 'rounded-lg',
actions: [ },
{
type: 'input-password',
name: 'password',
label: false,
placeholder: '请输入密码',
required: true,
className: 'mb-4',
inputClassName: 'rounded-lg',
},
{
type: 'flex',
justify: 'space-between',
className: 'mb-4',
items: [
{ {
type: 'action', type: 'button',
label: '注册', label: '注册账号',
className: 'text-blue-600 hover:text-blue-700',
level: 'link',
...userRegisterDialog(), ...userRegisterDialog(),
}, },
{ {
type: 'action', type: 'button',
actionType: 'submit', label: '忘记密码?',
label: '登陆', level: 'link',
level: 'primary', className: 'text-gray-600 hover:text-gray-700'
}, }
], ]
body: [
{
type: 'input-email',
name: 'username',
label: '邮箱',
placeholder: '请输入邮箱',
required: true,
clearable: true,
clearValueOnEmpty: true,
},
{
type: 'input-password',
name: 'password',
label: '密码',
placeholder: '请再次输入密码',
required: true,
},
],
}, },
], {
}, type: 'submit',
{ label: '登录',
xs: 0, level: 'primary',
sm: 0, className: 'w-full rounded-lg',
md: 4, size: 'lg'
body: [], }
}, ]
], }
}, ]
], }
]
} }
}) })