flat: 暂存
This commit is contained in:
@@ -16,14 +16,14 @@ import {
|
||||
ProFormText,
|
||||
} from '@ant-design/pro-components';
|
||||
import { useEmotionCss } from '@ant-design/use-emotion-css';
|
||||
import { FormattedMessage, history, SelectLang, useIntl, useModel, Helmet } from '@umijs/max';
|
||||
import { Alert, Col, message, Row, Tabs, Image } from 'antd';
|
||||
import { FormattedMessage, Helmet, history, SelectLang, useIntl, useModel } from '@umijs/max';
|
||||
import { Alert, Col, Image, message, Row, Tabs } from 'antd';
|
||||
import Settings from '../../../../config/defaultSettings';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { flushSync } from 'react-dom';
|
||||
// flushSync 允许你强制 React 同步刷新提供的回调中的任何更新。这确保了 DOM 立即更新
|
||||
import { clearSessionToken, setSessionToken } from '@/access';
|
||||
import {getRoutersInfo, setRemoteMenu} from "@/services/session";
|
||||
import logoImg from '@/assets/logo.svg'
|
||||
import logoImg from '@/assets/logo.svg';
|
||||
|
||||
const ActionIcons = () => {
|
||||
const langClassName = useEmotionCss(({ token }) => {
|
||||
@@ -87,7 +87,7 @@ const LoginMessage: React.FC<{
|
||||
};
|
||||
|
||||
const Login: React.FC = () => {
|
||||
const [userLoginState, setUserLoginState] = useState<API.LoginResult>({code: 200});
|
||||
const [userLoginState, setUserLoginState] = useState<API.LoginResult>({ code: 200 });
|
||||
const [type, setType] = useState<string>('account');
|
||||
const { initialState, setInitialState } = useModel('@@initialState');
|
||||
const [captchaCode, setCaptchaCode] = useState<string>('');
|
||||
@@ -143,7 +143,7 @@ const Login: React.FC = () => {
|
||||
console.log('login ok');
|
||||
const urlParams = new URL(window.location.href).searchParams;
|
||||
history.push(urlParams.get('redirect') || '/');
|
||||
setTimeout(() => history.go(0), 0)
|
||||
setTimeout(() => history.go(0), 0);
|
||||
return;
|
||||
} else {
|
||||
message.error(response.msg);
|
||||
|
||||
Reference in New Issue
Block a user