wzyyy 2 лет назад
Родитель
Сommit
e6d41f05cd
2 измененных файлов с 92 добавлено и 92 удалено
  1. 46 46
      src/pages/home/Api/index.tsx
  2. 46 46
      src/pages/system/Platforms/View/index.tsx

+ 46 - 46
src/pages/home/Api/index.tsx

@@ -1,8 +1,8 @@
-import { Button, Card, Col, Input, Popover, Row } from 'antd';
+import { Card, Col, Row } from 'antd';
 import { useEffect, useState } from 'react';
 import { service } from '@/pages/system/Platforms';
 import Service from '../service';
-import * as moment from 'moment';
+// import * as moment from 'moment';
 import ApiPage from '@/pages/system/Platforms/Api/base';
 
 const defaultHeight = 50;
@@ -11,7 +11,7 @@ export default () => {
   const api = new Service();
   const [clientId, setClientId] = useState('');
   const [secureKey, setSecureKey] = useState('');
-  const [sdkDetail, setSdkDetail] = useState<any>({});
+  // const [sdkDetail, setSdkDetail] = useState<any>({});
   const [loading, setLoading] = useState<boolean>(false);
 
   const getDetail = async (id: string) => {
@@ -25,29 +25,29 @@ export default () => {
     }
   };
 
-  const getSDKDetail = async () => {
-    const resp = await service.getSdk();
-    if (resp.status === 200) {
-      setSdkDetail(resp.result[0]);
-    }
-  };
+  // const getSDKDetail = async () => {
+  //   const resp = await service.getSdk();
+  //   if (resp.status === 200) {
+  //     setSdkDetail(resp.result[0]);
+  //   }
+  // };
 
-  const downLoad = (url: string) => {
-    if (url) {
-      const downNode = document.createElement('a');
-      downNode.href = url;
-      downNode.download = `${moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')}.sdk`;
-      downNode.style.display = 'none';
-      downNode.setAttribute('target', '_blank');
-      document.body.appendChild(downNode);
-      downNode.click();
-      document.body.removeChild(downNode);
-    }
-  };
+  // const downLoad = (url: string) => {
+  //   if (url) {
+  //     const downNode = document.createElement('a');
+  //     downNode.href = url;
+  //     downNode.download = `${moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')}.sdk`;
+  //     downNode.style.display = 'none';
+  //     downNode.setAttribute('target', '_blank');
+  //     document.body.appendChild(downNode);
+  //     downNode.click();
+  //     document.body.removeChild(downNode);
+  //   }
+  // };
 
   useEffect(() => {
     //  请求SDK下载地址
-    getSDKDetail();
+    // getSDKDetail();
     api.userDetail().then((res) => {
       if (res.status === 200) {
         api.apiDetail(res.result.id).then((response) => {
@@ -60,28 +60,28 @@ export default () => {
     });
   }, []);
 
-  const downLoadJDK = (
-    <div>
-      <div
-        style={{
-          width: 500,
-          borderRadius: 2,
-          marginBottom: 12,
-        }}
-      >
-        <Input.TextArea value={sdkDetail?.dependency} rows={6} readOnly />
-      </div>
-      <Button
-        type={'primary'}
-        style={{ width: '100%' }}
-        onClick={() => {
-          downLoad(sdkDetail.sdk);
-        }}
-      >
-        jar下载
-      </Button>
-    </div>
-  );
+  // const downLoadJDK = (
+  //   <div>
+  //     <div
+  //       style={{
+  //         width: 500,
+  //         borderRadius: 2,
+  //         marginBottom: 12,
+  //       }}
+  //     >
+  //       <Input.TextArea value={sdkDetail?.dependency} rows={6} readOnly />
+  //     </div>
+  //     <Button
+  //       type={'primary'}
+  //       style={{ width: '100%' }}
+  //       onClick={() => {
+  //         downLoad(sdkDetail.sdk);
+  //       }}
+  //     >
+  //       jar下载
+  //     </Button>
+  //   </div>
+  // );
 
   return (
     <Row gutter={[16, 16]}>
@@ -101,7 +101,7 @@ export default () => {
               </div>
             </Card>
           </Col>
-          <Col span={12}>
+          {/* <Col span={12}>
             <Card title="SDK下载">
               <div style={{ height: defaultHeight }}>
                 <Popover trigger="click" title={'POM依赖'} content={downLoadJDK}>
@@ -109,7 +109,7 @@ export default () => {
                 </Popover>
               </div>
             </Card>
-          </Col>
+          </Col> */}
         </Row>
       </Col>
       <Col span={24}>

+ 46 - 46
src/pages/system/Platforms/View/index.tsx

@@ -1,10 +1,10 @@
 import { PageContainer } from '@ant-design/pro-layout';
-import { Button, Card, Col, Input, Popover, Row } from 'antd';
+import { Card, Col, Row } from 'antd';
 import ApiPage from '../Api/base';
 import { useEffect, useState } from 'react';
 import { useLocation } from 'umi';
 import { service } from '@/pages/system/Platforms';
-import * as moment from 'moment';
+// import * as moment from 'moment';
 
 const defaultHeight = 50;
 
@@ -13,7 +13,7 @@ export default () => {
 
   const [clientId, setClientId] = useState('');
   const [secureKey, setSecureKey] = useState('');
-  const [sdkDetail, setSdkDetail] = useState<any>({});
+  // const [sdkDetail, setSdkDetail] = useState<any>({});
 
   const getDetail = async (id: string) => {
     const resp = await service.getDetail(id);
@@ -23,25 +23,25 @@ export default () => {
     }
   };
 
-  const getSDKDetail = async () => {
-    const resp = await service.getSdk();
-    if (resp.status === 200) {
-      setSdkDetail(resp.result[0]);
-    }
-  };
+  // const getSDKDetail = async () => {
+  //   const resp = await service.getSdk();
+  //   if (resp.status === 200) {
+  //     setSdkDetail(resp.result[0]);
+  //   }
+  // };
 
-  const downLoad = (url: string) => {
-    if (url) {
-      const downNode = document.createElement('a');
-      downNode.href = url;
-      downNode.download = `${moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')}.sdk`;
-      downNode.style.display = 'none';
-      downNode.setAttribute('target', '_blank');
-      document.body.appendChild(downNode);
-      downNode.click();
-      document.body.removeChild(downNode);
-    }
-  };
+  // const downLoad = (url: string) => {
+  //   if (url) {
+  //     const downNode = document.createElement('a');
+  //     downNode.href = url;
+  //     downNode.download = `${moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')}.sdk`;
+  //     downNode.style.display = 'none';
+  //     downNode.setAttribute('target', '_blank');
+  //     document.body.appendChild(downNode);
+  //     downNode.click();
+  //     document.body.removeChild(downNode);
+  //   }
+  // };
 
   useEffect(() => {
     const param = new URLSearchParams(location.search);
@@ -53,31 +53,31 @@ export default () => {
 
   useEffect(() => {
     //  请求SDK下载地址
-    getSDKDetail();
+    // getSDKDetail();
   }, []);
 
-  const downLoadJDK = (
-    <div>
-      <div
-        style={{
-          width: 500,
-          borderRadius: 2,
-          marginBottom: 12,
-        }}
-      >
-        <Input.TextArea value={sdkDetail?.dependency} rows={6} readOnly />
-      </div>
-      <Button
-        type={'primary'}
-        style={{ width: '100%' }}
-        onClick={() => {
-          downLoad(sdkDetail.sdk);
-        }}
-      >
-        jar下载
-      </Button>
-    </div>
-  );
+  // const downLoadJDK = (
+  //   <div>
+  //     <div
+  //       style={{
+  //         width: 500,
+  //         borderRadius: 2,
+  //         marginBottom: 12,
+  //       }}
+  //     >
+  //       <Input.TextArea value={sdkDetail?.dependency} rows={6} readOnly />
+  //     </div>
+  //     <Button
+  //       type={'primary'}
+  //       style={{ width: '100%' }}
+  //       onClick={() => {
+  //         downLoad(sdkDetail.sdk);
+  //       }}
+  //     >
+  //       jar下载
+  //     </Button>
+  //   </div>
+  // );
 
   return (
     <PageContainer>
@@ -98,7 +98,7 @@ export default () => {
                 </div>
               </Card>
             </Col>
-            <Col span={12}>
+            {/* <Col span={12}>
               <Card title="SDK下载">
                 <div style={{ height: defaultHeight }}>
                   <Popover trigger="click" title={'POM依赖'} content={downLoadJDK}>
@@ -106,7 +106,7 @@ export default () => {
                   </Popover>
                 </div>
               </Card>
-            </Col>
+            </Col> */}
           </Row>
         </Col>
         <Col span={24}>