diff --git a/src/components/ClearInfoDialog/index.tsx b/src/components/ClearInfoDialog/index.tsx index e9539d6..5b6441d 100644 --- a/src/components/ClearInfoDialog/index.tsx +++ b/src/components/ClearInfoDialog/index.tsx @@ -11,7 +11,7 @@ interface PageProps { } const ClearInfoDialog: FC = ({ - title = "提示框", + title = "提示", visibility = false, onCancel, onOk, diff --git a/src/pages/index.tsx b/src/pages/index.tsx index d9231c8..7e5a7d0 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,11 +1,12 @@ import { useEffect, useState } from 'react'; import styles from './index.less'; import { history } from 'umi' -import { Button, ConfigProvider, Form, Input, Modal, Radio } from 'antd'; +import { Button, ConfigProvider, Form, Input, Modal, Radio, message } from 'antd'; import ButtonComp from '@/components/ButtonComp'; import theme from '@/styles/antd.theme'; import { getPlugCordResult } from '@/services/api'; import { validateNumber } from '@/utils/validate'; +import ClearInfoDialog from '@/components/ClearInfoDialog'; // 首页 export default function IndexPage() { @@ -14,6 +15,7 @@ export default function IndexPage() { const [visibility, setVisibility] = useState(false); const [form] = Form.useForm(); const [loading, setLoading] = useState(false); + const [tishiDialog, setTishiDialog] = useState(false); const list = [ { name: '01MMD049安装.exe', img: '', url: '/installExe' }, @@ -44,9 +46,12 @@ export default function IndexPage() { const onFinish = async (data: any) => { setLoading(true) await getPlugCordResult(data).then(res => { - if (res?.result == 'success') { + if (res?.result == 'success' && res?.data[0]?.data) { setIsAuth(true) localStorage.setItem('is_auth', JSON.stringify(true)); + message.success("系统连接检测成功") + } else if (!res?.data[0]?.data) { + message.success("系统连接检测失败") } }) setLoading(false) @@ -91,11 +96,11 @@ export default function IndexPage() { 52 - - +