diff --git a/.umirc.ts b/.umirc.ts index e2aa127..bca2892 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -4,7 +4,7 @@ let publicPath = process.env.NODE_ENV === 'development' ? '/' : '/react/build/'; export default defineConfig({ publicPath, - title: '设施管理设备', + title: '管理基础设施', nodeModulesTransform: { type: 'none', }, diff --git a/src/pages/Basic/Header/index.tsx b/src/pages/Basic/Header/index.tsx index 2d37301..c2c27b3 100644 --- a/src/pages/Basic/Header/index.tsx +++ b/src/pages/Basic/Header/index.tsx @@ -1,5 +1,5 @@ import styles from './index.less'; -import { Fragment } from 'react'; +import { Fragment, useEffect } from 'react'; const Header = ({ ...props }) => { return ( diff --git a/src/pages/Basic/List/Certificate/Step2/index.tsx b/src/pages/Basic/List/Certificate/Step2/index.tsx index 6cad8cb..cb6056f 100644 --- a/src/pages/Basic/List/Certificate/Step2/index.tsx +++ b/src/pages/Basic/List/Certificate/Step2/index.tsx @@ -1,5 +1,5 @@ import styles from './index.less'; -import { Input, Button, Row, Form } from 'antd'; +import { Input, Button, Row, Form, InputNumber } from 'antd'; import { FC } from 'react'; import { connect, Dispatch, BasicInfoModelState } from 'umi'; @@ -114,29 +114,35 @@ const Page: FC = ({ basic, dispatch }) => {
CRL发布配置
- - + + + + + 建议证书数量设置在500以上 - - + + + + + 单位:分钟 diff --git a/src/pages/Basic/List/Device/index.tsx b/src/pages/Basic/List/Device/index.tsx index fba3137..0ce273f 100644 --- a/src/pages/Basic/List/Device/index.tsx +++ b/src/pages/Basic/List/Device/index.tsx @@ -53,12 +53,12 @@ const Page: FC = ({ basic, dispatch }) => { document.body.appendChild(inputObj); inputObj.click(); inputObj.onchange = (e: any) => { - console.log(e, 444); dispatch({ type: 'basic/setActionData', payload: { [type]: { file: e?.target?.files?.[0], + path: inputObj.value, }, }, }); @@ -246,7 +246,7 @@ const Page: FC = ({ basic, dispatch }) => { 导入64字节 @@ -265,7 +265,7 @@ const Page: FC = ({ basic, dispatch }) => { 导入32字节 @@ -286,7 +286,7 @@ const Page: FC = ({ basic, dispatch }) => { 导入20字节 @@ -305,7 +305,7 @@ const Page: FC = ({ basic, dispatch }) => { 导入16字节 diff --git a/src/pages/Basic/List/Index/index.tsx b/src/pages/Basic/List/Index/index.tsx index a9d76c7..5962ff4 100644 --- a/src/pages/Basic/List/Index/index.tsx +++ b/src/pages/Basic/List/Index/index.tsx @@ -38,6 +38,7 @@ const Page: FC = ({ basic, dispatch }) => { const getData = async () => { const res = await Fetch('/openi/resource/getResourceStatus'); if (res.result === 'success') { + document.title = '设施管理设备'; if (res?.data?.[0]?.resource && res?.data?.[0]?.cert) { message.warn('当前设备已开通,已为你跳转至管理设备界面!'); history.replace('/equipment'); diff --git a/src/pages/Encrypt/List/Index/index.tsx b/src/pages/Encrypt/List/Index/index.tsx index 9f178e8..8dd1623 100644 --- a/src/pages/Encrypt/List/Index/index.tsx +++ b/src/pages/Encrypt/List/Index/index.tsx @@ -22,7 +22,7 @@ interface PageProps {} const Page: FC = () => { const [type, setType] = useState('1'); const [algorithm, setAlgorithm] = useState('0'); - const [length, setLength] = useState(null); + const [length, setLength] = useState('2'); const [file, setFile] = useState([]); const item: any = [ @@ -70,16 +70,13 @@ const Page: FC = () => { message.warn('请选择导入文件'); return; } - if (!length) { - message.warn('请输入密钥长度'); - return; - } + // if (type !== '2' && !length) { + // message.warn('请输入密钥长度'); + // return; + // } downLoadLink( `${url}/openi/secretKey/encryption?type=${type}&algorithm=${algorithm}&length=${length}&count=${file.length}`, ); - setTimeout(() => { - history.push('/manager/passwordManager'); - }, 500); }; const renderText = () => { @@ -101,6 +98,8 @@ const Page: FC = () => { className={type === e.key ? styles.active : ''} onClick={() => { setType(e.key); + setLength('2'); + setFile([]); if (e.key === '2') { setAlgorithm('1'); } else { @@ -147,15 +146,24 @@ const Page: FC = () => { )} -
- * - 密钥长度 - setLength(k)} - style={{ width: 400 }} - /> -
+ {type !== '2' && ( +
+ * + 密钥长度 + + +
+ )}
diff --git a/src/pages/Equipment/Header/index.tsx b/src/pages/Equipment/Header/index.tsx index 2ee791a..21fedb6 100644 --- a/src/pages/Equipment/Header/index.tsx +++ b/src/pages/Equipment/Header/index.tsx @@ -27,6 +27,7 @@ const Header = ({ ...props }) => { //判断否跳转 const res = await Fetch('/openi/resource/getResourceStatus'); if (res.result === 'success') { + document.title = '设施管理设备'; if (!(res?.data?.[0]?.resource && res?.data?.[0]?.cert)) { message.warn('当前设备未开通,已为你跳转至开通界面!'); history.replace('/basic'); diff --git a/src/pages/Equipment/List/DataCenter/index.tsx b/src/pages/Equipment/List/DataCenter/index.tsx index 9319f5e..5c2ebab 100644 --- a/src/pages/Equipment/List/DataCenter/index.tsx +++ b/src/pages/Equipment/List/DataCenter/index.tsx @@ -26,6 +26,7 @@ const Page: FC = () => { const getData = async () => { const res = await Fetch('/openi/dataCenter/isOpen'); if (res.result === 'success') { + document.title = '数据中心开通'; if (res?.data?.[0]) { setDisable(true); return; diff --git a/src/pages/Equipment/List/LocalManager/index.tsx b/src/pages/Equipment/List/LocalManager/index.tsx index 0611e13..8138e2c 100644 --- a/src/pages/Equipment/List/LocalManager/index.tsx +++ b/src/pages/Equipment/List/LocalManager/index.tsx @@ -26,6 +26,7 @@ const Page: FC = () => { const getData = async () => { const res = await Fetch('/openi/localManager/isOpen'); if (res.result === 'success') { + document.title = '管理基础设施'; if (res?.data?.[0]) { message.warn('当前本地管理终端已开通,已为你跳转至管理基础设施界面!'); history.replace('/manager/passwordManager'); @@ -122,7 +123,7 @@ const Page: FC = () => { 终端类型:
    {items.map((e: any) => ( -
  • setTerminalType(e.name)}> +
  • setTerminalType(e.name)}> {e.name}
  • diff --git a/src/pages/Manager/BasicManager/List/Allotment/index.tsx b/src/pages/Manager/BasicManager/List/Allotment/index.tsx index 755e09b..0c1e1fd 100644 --- a/src/pages/Manager/BasicManager/List/Allotment/index.tsx +++ b/src/pages/Manager/BasicManager/List/Allotment/index.tsx @@ -412,7 +412,10 @@ const Page: FC = () => { }, ]} > - + diff --git a/src/pages/Manager/Header/index.tsx b/src/pages/Manager/Header/index.tsx index 606c74c..cf4ec5a 100644 --- a/src/pages/Manager/Header/index.tsx +++ b/src/pages/Manager/Header/index.tsx @@ -11,6 +11,7 @@ const Header = ({ ...props }) => { const getData = async () => { const res = await Fetch('/openi/localManager/isOpen'); if (res.result === 'success') { + document.title = '管理基础设施'; if (!res?.data?.[0]) { message.warn('当前本地管理终端未开通,已为你跳转至终端界面!'); history.replace('/terminal'); diff --git a/src/pages/Manager/PasswordManager/index.tsx b/src/pages/Manager/PasswordManager/index.tsx index 155e55e..e123e99 100644 --- a/src/pages/Manager/PasswordManager/index.tsx +++ b/src/pages/Manager/PasswordManager/index.tsx @@ -23,7 +23,7 @@ interface PageProps {} const Page: FC = () => { const [type, setType] = useState('1'); const [algorithm, setAlgorithm] = useState('0'); - const [length, setLength] = useState('16'); + const [length, setLength] = useState('2'); const [pushNode, setPushNode] = useState('节点一'); const [count, setCount] = useState(1000); const [data, setData] = useState([]); @@ -82,19 +82,32 @@ const Page: FC = () => { inputObj.onchange = async (e: any) => { const data: any = new FormData(); data.append('file', e?.target?.files?.[0]); - const res = await Fetch('/openi/secretKey/resourceImport', { + const res = await Fetch(`/openi/secretKey/resourceImport/${type}`, { method: 'post', data, }); if (res.result === 'success') { message.success('导入成功'); getData(); + } else { + message.error(res.errorMsg); } }; }; const title = item.find((e: any) => e.key === type).name; + const items = [ + { + key: '1', + name: 'ECC359', + }, + { + key: '2', + name: 'ECC281', + }, + ]; + const option = { tooltip: { trigger: 'axis', @@ -115,7 +128,12 @@ const Page: FC = () => { }, yAxis: { type: 'category', - data: data?.map((e: any) => e.length), + data: data?.map((e: any) => { + if (type !== '2') { + return e.length; + } + return items.find((k: any) => k.key === e.algorithm)?.name; + }), }, series: [ { @@ -142,6 +160,10 @@ const Page: FC = () => { algorithm, }, }); + if (res.errorCode === 500) { + message.warn(res.errorMsg); + return; + } if (res.result === 'success') { message.success('推出成功'); getData(); @@ -204,11 +226,11 @@ const Page: FC = () => { value={length} onChange={(k) => setLength(k)} > - {'16'} - {'20'} - {'32'} - {'64'} - {'128'} + 2 + 4 + 8 + 16 + 32 @@ -230,8 +252,9 @@ const Page: FC = () => { onChange={(k) => setAlgorithm(k)} style={{ width: 100 }} > - {'ECC359'} - {'ECC281'} + {items.map((e: any) => ( + {e.name} + ))} )} diff --git a/src/pages/Simulation/index.tsx b/src/pages/Simulation/index.tsx index 7c4dba0..588ffac 100644 --- a/src/pages/Simulation/index.tsx +++ b/src/pages/Simulation/index.tsx @@ -141,6 +141,10 @@ const Page = () => { console.log(data, 'data'); + useEffect(() => { + document.title = '初装系统'; + }, []); + useEffect(() => { window.addEventListener('message', getData, false); return () => {