chore: get start from deploying

This commit is contained in:
jialin
2025-02-24 11:34:40 +08:00
parent 1dd7037aa0
commit bcbefe29e7
11 changed files with 214 additions and 26 deletions
+6 -5
View File
@@ -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) {
+4 -5
View File
@@ -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) => {