1717 *
1818 */
1919
20- import { API_CONSTANTS } from '@/services/endpoints' ;
21- import { l } from '@/utils/intl' ;
22- import { GithubOutlined , LockOutlined , UserOutlined } from '@ant-design/icons' ;
23- import { DefaultFooter , ProForm , ProFormCheckbox , ProFormText } from '@ant-design/pro-components' ;
24- import { SubmitterProps } from '@ant-design/pro-form/es/components' ;
25- import { Col , Flex , Row } from 'antd' ;
26- import React , { useState } from 'react' ;
20+ import { API_CONSTANTS } from '@/services/endpoints' ;
21+ import { l } from '@/utils/intl' ;
22+ import { GithubOutlined , LockOutlined , UserOutlined } from '@ant-design/icons' ;
23+ import { DefaultFooter , ProForm , ProFormCheckbox , ProFormText } from '@ant-design/pro-components' ;
24+ import { SubmitterProps } from '@ant-design/pro-form/es/components' ;
25+ import { Col , Flex , Row } from 'antd' ;
26+ import React , { useState } from 'react' ;
2727import style from '../../../../global.less' ;
2828import Lottie from 'react-lottie' ;
2929import DataPlatform from '../../../../../public/login_animation.json' ;
30- import { useRequest } from '@@/exports' ;
31- import { history } from '@umijs/max' ;
32- import { GLOBAL_SETTING_KEYS } from '@/types/SettingCenter/data.d' ;
30+ import { useRequest } from '@@/exports' ;
31+ import { history } from '@umijs/max' ;
32+ import { GLOBAL_SETTING_KEYS } from '@/types/SettingCenter/data.d' ;
3333
3434type LoginFormProps = {
3535 onSubmit : ( values : any ) => Promise < void > ;
3636} ;
3737
3838const LoginForm : React . FC < LoginFormProps > = ( props ) => {
39- const { onSubmit } = props ;
39+ const { onSubmit} = props ;
4040
4141 const [ form ] = ProForm . useForm ( ) ;
4242
@@ -55,7 +55,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
5555
5656 const handleClickLogin = async ( ) => {
5757 setSubmitting ( true ) ;
58- await onSubmit ( { ...form . getFieldsValue ( ) } ) ;
58+ await onSubmit ( { ...form . getFieldsValue ( ) } ) ;
5959 setSubmitting ( false ) ;
6060 } ;
6161
@@ -66,7 +66,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
6666 name = 'username'
6767 fieldProps = { {
6868 size : 'large' ,
69- prefix : < UserOutlined />
69+ prefix : < UserOutlined />
7070 } }
7171 required
7272 placeholder = { l ( 'login.username.placeholder' ) }
@@ -81,7 +81,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
8181 name = 'password'
8282 fieldProps = { {
8383 size : 'large' ,
84- prefix : < LockOutlined />
84+ prefix : < LockOutlined />
8585 } }
8686 placeholder = { l ( 'login.password.placeholder' ) }
8787 rules = { [
@@ -95,7 +95,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
9595 < Col span = { 12 } >
9696 < ProFormCheckbox name = 'autoLogin' > { l ( 'login.rememberMe' ) } </ ProFormCheckbox >
9797 </ Col >
98- < Col span = { 12 } style = { { textAlign : 'right' } } >
98+ < Col span = { 12 } style = { { textAlign : 'right' } } >
9999 < ProFormCheckbox name = 'ldapLogin' hidden = { ! ldapEnabled } >
100100 { l ( 'login.ldapLogin' ) }
101101 </ ProFormCheckbox >
@@ -106,15 +106,15 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
106106 } ;
107107
108108 const proFormSubmitter : SubmitterProps = {
109- searchConfig : { submitText : l ( 'menu.login' ) } ,
109+ searchConfig : { submitText : l ( 'menu.login' ) } ,
110110 resetButtonProps : false ,
111111 submitButtonProps : {
112112 loading : submitting ,
113113 autoFocus : true ,
114114 htmlType : 'submit' ,
115115 size : 'large' ,
116116 shape : 'round' ,
117- style : { width : '100%' }
117+ style : { width : '100%' }
118118 }
119119 } ;
120120
@@ -140,34 +140,40 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
140140 } }
141141 >
142142 < Col
143- style = { { padding : '5%' , backgroundColor : '#fff' } }
143+ style = { { padding : '5%' , backgroundColor : '#fff' , display : 'flex' , flexDirection : 'column' , justifyContent : "center" } }
144144 xs = { 24 }
145145 sm = { 24 }
146- md = { 10 }
147- lg = { 8 }
148- xl = { 8 }
146+ md = { 24 }
147+ lg = { 24 }
148+ xl = { 14 }
149149 xxl = { 8 }
150150 >
151- < Row
152- style = { { color : '#00b0ff' , marginBottom : 60 , justifyContent : 'center' } }
153- align = { 'middle' }
154- >
155- < img src = { './dinky.svg' } width = { 150 } alt = { '' } />
156- < h1 style = { { margin : '0' } } > { l ( 'layouts.userLayout.title' ) } </ h1 >
157- </ Row >
151+ < Row >
152+ < Col xl = { 12 } xxl = { 24 } >
153+ < Row
154+ style = { { color : '#00b0ff' , marginBottom : 60 , justifyContent : 'center' } }
155+ align = { 'middle' }
156+ >
157+ < img src = { './dinky.svg' } width = { 150 } alt = { '' } />
158+ < h1 style = { { margin : '0' } } > { l ( 'layouts.userLayout.title' ) } </ h1 >
159+ </ Row >
160+ </ Col >
158161
159- < ProForm
160- className = { style . loginform }
161- form = { form }
162- onFinish = { handleClickLogin }
163- initialValues = { { autoLogin : true } }
164- submitter = { { ...proFormSubmitter } }
165- >
166- { renderLoginForm ( ) }
167- </ ProForm >
162+ < Col xl = { 12 } xxl = { 24 } >
163+ < ProForm
164+ className = { style . loginform }
165+ form = { form }
166+ onFinish = { handleClickLogin }
167+ initialValues = { { autoLogin : true } }
168+ submitter = { { ...proFormSubmitter } }
169+ >
170+ { renderLoginForm ( ) }
171+ </ ProForm >
172+ </ Col >
173+ </ Row >
168174 < DefaultFooter
169175 copyright = { `${ new Date ( ) . getFullYear ( ) } ` + l ( 'app.copyright.produced' ) }
170- style = { { backgroundColor : '#fff' } }
176+ style = { { backgroundColor : '#fff' } }
171177 links = { [
172178 {
173179 key : 'Dinky' ,
@@ -177,7 +183,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
177183 } ,
178184 {
179185 key : 'github' ,
180- title : < GithubOutlined /> ,
186+ title : < GithubOutlined /> ,
181187 href : 'https://github.com/DataLinkDC/dinky' ,
182188 blankTarget : true
183189 }
@@ -187,17 +193,17 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
187193 < Col
188194 xs = { 0 }
189195 sm = { 0 }
190- md = { 14 }
191- lg = { 16 }
192- xl = { 16 }
196+ md = { 0 }
197+ lg = { 0 }
198+ xl = { 10 }
193199 xxl = { 16 }
194200 style = { {
195201 backgroundImage : 'linear-gradient(135deg,#1fa2ff,#12d8fa,#a6ffcb)' ,
196202 width : '100%' ,
197203 height : '100%'
198204 } }
199205 >
200- < Flex align = { 'center' } style = { { width : '100%' , height : '100%' } } >
206+ < Flex align = { 'center' } style = { { width : '100%' , height : '100%' } } >
201207 < Lottie
202208 options = { {
203209 loop : true ,
@@ -220,7 +226,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
220226 src = { './icons/footer-bg.svg' }
221227 width = { '100%' }
222228 alt = { '' }
223- style = { { position : 'absolute' , bottom : 0 } }
229+ style = { { position : 'absolute' , bottom : 0 } }
224230 />
225231 </ >
226232 ) ;
0 commit comments