From a9230ddfb30ccb936944444e9140c2f6d327f839 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 26 二月 2024 17:03:53 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/User/Login/index2.jsx | 43 +++++++++++++++++++++++++++++++++++++++++--
1 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/zy-asrs-flow/src/pages/User/Login/index2.jsx b/zy-asrs-flow/src/pages/User/Login/index2.jsx
index 0f0ed65..f9e5ff1 100644
--- a/zy-asrs-flow/src/pages/User/Login/index2.jsx
+++ b/zy-asrs-flow/src/pages/User/Login/index2.jsx
@@ -10,17 +10,51 @@
ProFormCheckbox,
ProFormText,
} from '@ant-design/pro-components';
-import { Button, Divider, Space, Tabs, message, theme } from 'antd';
+import { Button, Divider, Alert, Tabs, message, theme } from 'antd';
import { useState } from 'react';
import { FormattedMessage, history, SelectLang, useIntl, useModel, Helmet } from '@umijs/max';
+import { flushSync } from 'react-dom';
+import { request } from '@umijs/max';
+import { setToken } from '@/utils/token-util'
+import { PROJECT_NAME } from '@/config/setting'
import logo from './logo.png'
+const LoginMessage = ({ content }) => {
+ return (
+ <Alert
+ style={{
+ marginBottom: 24,
+ }}
+ message={content}
+ type="error"
+ showIcon
+ />
+ );
+};
+
const Page = () => {
const intl = useIntl();
+ const { initialState, setInitialState } = useModel('@@initialState');
+ const { token } = theme.useToken();
const [loginType, setLoginType] = useState('account');
- const { token } = theme.useToken();
+ const [userLoginState, setUserLoginState] = useState({});
+ const [status, setStatus] = useState(200);
+
+ console.log(initialState.memo);
+
+ const fetchUserInfo = async () => {
+ const userInfo = await initialState?.fetchUserInfo?.();
+ if (userInfo) {
+ flushSync(() => {
+ setInitialState((s) => ({
+ ...s,
+ currentUser: userInfo,
+ }));
+ });
+ }
+ };
const handleSubmit = async (values) => {
try {
@@ -136,6 +170,11 @@
/>
</>
)}
+ {status !== 200 && loginType === 'account' && (
+ <LoginMessage
+ content={'璐︽埛鎴栧瘑鐮侀敊璇�'}
+ />
+ )}
{loginType === 'phone' && (
<>
<ProFormText
--
Gitblit v1.9.1