|
|
|
|
@ -4,7 +4,7 @@ import {
|
|
|
|
|
Checkbox,
|
|
|
|
|
Link,
|
|
|
|
|
Button,
|
|
|
|
|
Space,
|
|
|
|
|
Space
|
|
|
|
|
} from '@arco-design/web-react';
|
|
|
|
|
import { FormInstance } from '@arco-design/web-react/es/Form';
|
|
|
|
|
import { IconLock, IconUser } from '@arco-design/web-react/icon';
|
|
|
|
|
@ -30,13 +30,14 @@ export default function LoginForm() {
|
|
|
|
|
// 记住密码
|
|
|
|
|
if (rememberPassword) {
|
|
|
|
|
setLoginParams(JSON.stringify(params));
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
removeLoginParams();
|
|
|
|
|
}
|
|
|
|
|
// 记录登录状态
|
|
|
|
|
localStorage.setItem('userStatus', 'login');
|
|
|
|
|
// 跳转首页
|
|
|
|
|
window.location.href = '/';
|
|
|
|
|
window.location.href = '/dashboard/workplace';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function login(params) {
|
|
|
|
|
@ -48,7 +49,8 @@ export default function LoginForm() {
|
|
|
|
|
const { status, msg } = res.data;
|
|
|
|
|
if (status === 'ok') {
|
|
|
|
|
afterLoginSuccess(params);
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
setErrorMessage(msg || t['login.form.login.errMsg']);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
@ -111,18 +113,10 @@ export default function LoginForm() {
|
|
|
|
|
<Checkbox checked={rememberPassword} onChange={setRememberPassword}>
|
|
|
|
|
{t['login.form.rememberPassword']}
|
|
|
|
|
</Checkbox>
|
|
|
|
|
<Link suppressHydrationWarning>{t['login.form.forgetPassword']}</Link>
|
|
|
|
|
</div>
|
|
|
|
|
<Button type="primary" long onClick={onSubmitClick} loading={loading}>
|
|
|
|
|
{t['login.form.login']}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
type="text"
|
|
|
|
|
long
|
|
|
|
|
className={styles['login-form-register-btn']}
|
|
|
|
|
>
|
|
|
|
|
{t['login.form.register']}
|
|
|
|
|
</Button>
|
|
|
|
|
</Space>
|
|
|
|
|
</Form>
|
|
|
|
|
</div>
|
|
|
|
|
|