chore: get start from deploying
This commit is contained in:
@@ -8,13 +8,14 @@ import {
|
||||
removeRememberMe
|
||||
} from '@/utils/localstore/index';
|
||||
import { LockOutlined, UserOutlined } from '@ant-design/icons';
|
||||
import { history, useIntl, useModel } from '@umijs/max';
|
||||
import { useIntl, useModel } from '@umijs/max';
|
||||
import { Button, Checkbox, Form } from 'antd';
|
||||
import CryptoJS from 'crypto-js';
|
||||
import { useAtom } from 'jotai';
|
||||
import { memo, useEffect, useMemo } from 'react';
|
||||
import { flushSync } from 'react-dom';
|
||||
import { login } from '../apis';
|
||||
import { checkDefaultPage } from '../utils';
|
||||
|
||||
const REMEMBER_ME_KEY = 'r_m';
|
||||
const CRYPT_TEXT = 'seal';
|
||||
@@ -50,11 +51,10 @@ const LoginForm = () => {
|
||||
);
|
||||
}, [intl]);
|
||||
|
||||
const gotoDefaultPage = (userInfo: any) => {
|
||||
const pathname =
|
||||
userInfo && userInfo?.is_admin ? '/dashboard' : '/playground';
|
||||
history.push(pathname);
|
||||
const gotoDefaultPage = async (userInfo: any) => {
|
||||
checkDefaultPage(userInfo, true);
|
||||
};
|
||||
|
||||
const fetchUserInfo = async () => {
|
||||
const userInfo = await initialState?.fetchUserInfo?.();
|
||||
|
||||
@@ -108,6 +108,7 @@ const LoginForm = () => {
|
||||
username: values.username,
|
||||
password: values.password
|
||||
});
|
||||
|
||||
const userInfo = await fetchUserInfo();
|
||||
setUserInfo(userInfo);
|
||||
if (values.autoLogin) {
|
||||
|
||||
@@ -2,11 +2,12 @@ import { initialPasswordAtom, userAtom } from '@/atoms/user';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { PasswordReg } from '@/config';
|
||||
import { GlobalOutlined, LockOutlined } from '@ant-design/icons';
|
||||
import { SelectLang, history, useIntl } from '@umijs/max';
|
||||
import { SelectLang, useIntl } from '@umijs/max';
|
||||
import { Button, Form, message } from 'antd';
|
||||
import CryptoJS from 'crypto-js';
|
||||
import { useAtom } from 'jotai';
|
||||
import { updatePassword } from '../apis';
|
||||
import { checkDefaultPage } from '../utils';
|
||||
|
||||
const CRYPT_TEXT = 'seal';
|
||||
|
||||
@@ -16,10 +17,8 @@ const PasswordForm: React.FC = () => {
|
||||
|
||||
const [userInfo, setUserInfo] = useAtom(userAtom);
|
||||
const [initialPassword, setInitialPassword] = useAtom(initialPasswordAtom);
|
||||
const gotoDefaultPage = (userInfo: any) => {
|
||||
const pathname =
|
||||
userInfo && userInfo?.is_admin ? '/dashboard' : '/playground';
|
||||
history.push(pathname);
|
||||
const gotoDefaultPage = async (userInfo: any) => {
|
||||
checkDefaultPage(userInfo, false);
|
||||
};
|
||||
|
||||
const decryptPassword = (password: string) => {
|
||||
|
||||
Reference in New Issue
Block a user