1
0
Files
gringotts/gringotts-frontend/pages/login/main.js

107 lines
4.5 KiB
JavaScript

import {useAmis} from '../../components/constants.js'
import {userRegisterDialog} from '../../components/user/dialog-user-register.js'
useAmis(information => {
return {
type: 'page',
className: 'h-screen bg-gray-900',
bodyClassName: 'h-full flex items-start mt-20',
body: [
{
type: 'wrapper',
className: 'relative w-full max-w-md mx-auto',
body: [
{
type: 'flex',
justify: 'center',
className: 'mb-8',
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'
}
]
}
]
},
{
type: 'form',
className: 'bg-white rounded-xl p-10 shadow-2xl',
api: '${base}/user/login',
redirect: '/pages/index/index.html?token=${token}',
mode: 'normal',
wrapWithPanel: false,
body: [
{
type: 'input-email',
name: 'username',
label: false,
placeholder: '请输入邮箱',
required: true,
clearable: true,
className: 'mb-4',
inputClassName: 'rounded-lg',
},
{
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: 'button',
label: '注册账号',
className: 'text-blue-600 hover:text-blue-700',
level: 'link',
...userRegisterDialog(),
},
{
type: 'button',
label: '忘记密码?',
level: 'link',
className: 'text-gray-600 hover:text-gray-700'
}
]
},
{
type: 'submit',
label: '登录',
level: 'primary',
className: 'w-full rounded-lg',
size: 'lg'
}
]
}
]
}
]
}
})