|
|
@ -8,110 +8,110 @@ import { IconLock, IconUser } from '@douyinfe/semi-icons'; |
|
|
|
import '../style.less' |
|
|
|
|
|
|
|
const Login = props => { |
|
|
|
const { dispatch, user, error, actions, apiRoot, isRequesting } = props |
|
|
|
const form = useRef(); |
|
|
|
const { dispatch, user, error, actions, apiRoot, isRequesting } = props |
|
|
|
const form = useRef(); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (error) { |
|
|
|
Toast.error(error); |
|
|
|
form.current.setValue('password', '') |
|
|
|
} |
|
|
|
}, [error]) |
|
|
|
useEffect(() => { |
|
|
|
if (error) { |
|
|
|
Toast.error(error); |
|
|
|
form.current.setValue('password', '') |
|
|
|
} |
|
|
|
}, [error]) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (user && user.authorized) { |
|
|
|
dispatch(push('/humanAffairs/archivesCenter/personnelArchives/personnelFiles')); |
|
|
|
localStorage.setItem('poms_open_sider', JSON.stringify(["archivesCenter"])) |
|
|
|
localStorage.setItem('poms_selected_sider', JSON.stringify(["humanAffairs"])) |
|
|
|
} |
|
|
|
}, [user]) |
|
|
|
useEffect(() => { |
|
|
|
if (user && user.authorized) { |
|
|
|
dispatch(push('/humanAffairs/archivesCenter/personnelArchives/personnelFiles')); |
|
|
|
localStorage.setItem('poms_open_sider', JSON.stringify(["archivesCenter"])) |
|
|
|
localStorage.setItem('poms_selected_sider', JSON.stringify(["humanAffairs"])) |
|
|
|
} |
|
|
|
}, [user]) |
|
|
|
|
|
|
|
return ( |
|
|
|
<div style={{ |
|
|
|
width: '100%', |
|
|
|
height: '100%', |
|
|
|
background: '#F0F4FF', |
|
|
|
}}> |
|
|
|
<div style={{ |
|
|
|
width: '57.64%', |
|
|
|
height: '100%' |
|
|
|
}}> |
|
|
|
<div className='zoomImage'> |
|
|
|
<img src="/assets/images/background/loginText.png" style={{ width: 587, height: 81, margin: "143px 0 0 69px" }} /> |
|
|
|
</div> |
|
|
|
return ( |
|
|
|
<div style={{ |
|
|
|
width: '100%', |
|
|
|
height: '100%', |
|
|
|
background: '#F0F4FF', |
|
|
|
}}> |
|
|
|
<div style={{ |
|
|
|
width: '57.64%', |
|
|
|
height: '100%' |
|
|
|
}}> |
|
|
|
<div className='zoomImage'> |
|
|
|
<img src="/assets/images/background/loginText.png" style={{ width: 587, height: 81, margin: "143px 0 0 69px" }} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ |
|
|
|
width: '42.36%', |
|
|
|
height: '100%', |
|
|
|
padding: '45px 60px', |
|
|
|
background: 'rgb(255 255 255 / 50%)', |
|
|
|
backdropFilter: "saturate(100%) contrast(100%) blur(17px)", |
|
|
|
position: 'absolute', |
|
|
|
top: 0, |
|
|
|
right: 0, |
|
|
|
zIndex: "6", |
|
|
|
textAlign: 'center', |
|
|
|
display: 'flex', |
|
|
|
justifyContent: 'center', |
|
|
|
background: '#FFFFFF' |
|
|
|
}}> |
|
|
|
<div style={{ |
|
|
|
width: '42.36%', |
|
|
|
height: '100%', |
|
|
|
padding: '45px 60px', |
|
|
|
background: 'rgb(255 255 255 / 50%)', |
|
|
|
backdropFilter: "saturate(100%) contrast(100%) blur(17px)", |
|
|
|
position: 'absolute', |
|
|
|
top: 0, |
|
|
|
right: 0, |
|
|
|
zIndex: "6", |
|
|
|
textAlign: 'center', |
|
|
|
display: 'flex', |
|
|
|
justifyContent: 'center', |
|
|
|
background: '#FFFFFF' |
|
|
|
width: 388, |
|
|
|
marginTop: "18.33%" |
|
|
|
}}> |
|
|
|
<div style={{ |
|
|
|
width: 388, |
|
|
|
marginTop: "18.33%" |
|
|
|
}}> |
|
|
|
<div style={{ fontSize: 31, color: '#000000', marginBottom: 90 }}> |
|
|
|
FS-EIMS企业信息管理系统 |
|
|
|
</div> |
|
|
|
<Form |
|
|
|
onSubmit={values => { |
|
|
|
dispatch(login(values.username, values.password)).then(res => { |
|
|
|
const data = res.payload.user |
|
|
|
localStorage.setItem('word', JSON.stringify(values.password)) |
|
|
|
dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token, hrUserId: data.hrUserInfo && hrUserInfo.id })) |
|
|
|
}) |
|
|
|
}} |
|
|
|
getFormApi={formApi => form.current = formApi} |
|
|
|
> |
|
|
|
<Form.Input |
|
|
|
className='inputbgc' |
|
|
|
field='username' |
|
|
|
noLabel={true} |
|
|
|
label='用户名' |
|
|
|
placeholder='请输入账号' |
|
|
|
prefix={<IconUser style={{ color: '#717171', marginRight: 14, marginLeft: 8 }} />} |
|
|
|
style={{ background: '#FFFFFF', height: 46, marginBottom: 33, border: '1px solid rgb(185 211 239)', borderRadius: '4px' }} |
|
|
|
/> |
|
|
|
<Form.Input |
|
|
|
field='password' |
|
|
|
noLabel={true} |
|
|
|
mode="password" |
|
|
|
autoComplete="" |
|
|
|
placeholder='请输入密码' |
|
|
|
label='密码' |
|
|
|
prefix={<IconLock style={{ color: '#717171', marginRight: 14, marginLeft: 8 }} />} |
|
|
|
style={{ background: '#FFFFFF', height: 46, border: '1px solid rgb(185 211 239)', borderRadius: '4px' }} |
|
|
|
/> |
|
|
|
<img src="/assets/images/background/xiangqi.png" style={{ width: 112, height: 14, margin: "4px 0 0 278px" }} /> |
|
|
|
<Button htmlType='submit' block theme="solid" loading={isRequesting} style={{ marginTop: 56, height: 46, backgroundColor: '#0F7EFB', borderRadius: '27px' }}>立即登录</Button> |
|
|
|
|
|
|
|
</Form> |
|
|
|
<div style={{ fontSize: 31, color: '#000000', marginBottom: 90 }}> |
|
|
|
FS-EIMS企业信息管理系统 |
|
|
|
</div> |
|
|
|
<Form |
|
|
|
onSubmit={values => { |
|
|
|
dispatch(login({ username: values.username, password: values.password })).then(res => { |
|
|
|
const data = res.payload.user |
|
|
|
localStorage.setItem('word', JSON.stringify(values.password)) |
|
|
|
dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token, hrUserId: data.hrUserInfo && hrUserInfo.id })) |
|
|
|
}) |
|
|
|
}} |
|
|
|
getFormApi={formApi => form.current = formApi} |
|
|
|
> |
|
|
|
<Form.Input |
|
|
|
className='inputbgc' |
|
|
|
field='username' |
|
|
|
noLabel={true} |
|
|
|
label='用户名' |
|
|
|
placeholder='请输入账号' |
|
|
|
prefix={<IconUser style={{ color: '#717171', marginRight: 14, marginLeft: 8 }} />} |
|
|
|
style={{ background: '#FFFFFF', height: 46, marginBottom: 33, border: '1px solid rgb(185 211 239)', borderRadius: '4px' }} |
|
|
|
/> |
|
|
|
<Form.Input |
|
|
|
field='password' |
|
|
|
noLabel={true} |
|
|
|
mode="password" |
|
|
|
autoComplete="" |
|
|
|
placeholder='请输入密码' |
|
|
|
label='密码' |
|
|
|
prefix={<IconLock style={{ color: '#717171', marginRight: 14, marginLeft: 8 }} />} |
|
|
|
style={{ background: '#FFFFFF', height: 46, border: '1px solid rgb(185 211 239)', borderRadius: '4px' }} |
|
|
|
/> |
|
|
|
<img src="/assets/images/background/xiangqi.png" style={{ width: 112, height: 14, margin: "4px 0 0 278px" }} /> |
|
|
|
<Button htmlType='submit' block theme="solid" loading={isRequesting} style={{ marginTop: 56, height: 46, backgroundColor: '#0F7EFB', borderRadius: '27px' }}>立即登录</Button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</Form> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div > |
|
|
|
); |
|
|
|
|
|
|
|
</div> |
|
|
|
</div > |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
function mapStateToProps(state) { |
|
|
|
const { auth, global } = state; |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|
error: auth.error, |
|
|
|
actions: global.actions, |
|
|
|
apiRoot: global.apiRoot, |
|
|
|
isRequesting: auth.isRequesting |
|
|
|
} |
|
|
|
function mapStateToProps (state) { |
|
|
|
const { auth, global } = state; |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|
error: auth.error, |
|
|
|
actions: global.actions, |
|
|
|
apiRoot: global.apiRoot, |
|
|
|
isRequesting: auth.isRequesting |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export default connect(mapStateToProps)(Login); |