Sfoglia il codice sorgente

update push.sh
change remote address

tianyunperfect 5 anni fa
parent
commit
d2739e3216
3 ha cambiato i file con 26 aggiunte e 18 eliminazioni
  1. 2 2
      bin/push.sh
  2. 5 1
      src/pages/Memory/components/UpdateForm.tsx
  3. 19 15
      src/pages/Memory/index.tsx

+ 2 - 2
bin/push.sh

@@ -1,6 +1,6 @@
-remote=worker@10.20.222.191
+remote=root@www.tianyunperfect.cn
 
 # 在本地执行的代码,比如上传文件到服务器 scp 本地文件 user@ip:远程目录
-scp -r dist/* ${remote}:/apps/bainuo/bainuo-model2/static
+scp -r dist/* ${remote}:/app/memory/static
 
 echo ok

+ 5 - 1
src/pages/Memory/components/UpdateForm.tsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import React, {useEffect} from 'react';
 import {Button, message, Modal} from 'antd';
 import {TableListItem} from '../../MemoryList/data.d';
 import Quill from "@/pages/Memory/components/Quill";
@@ -33,6 +33,10 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
     modalVisible,
   } = props;
 
+  useEffect(()=>{
+    console.log(props);
+  },[])
+
 
   return (
     <Modal

+ 19 - 15
src/pages/Memory/index.tsx

@@ -57,9 +57,9 @@ const TableList: React.FC<{}> = () => {
   };
   useEffect(() => {
     countRemind();
-    setTimeout( ()=> {
+    setTimeout(() => {
       countRemind();
-    },1000*60*60)  // 每隔一个小时查询一次
+    }, 1000 * 60 * 60)  // 每隔一个小时查询一次
   }, []);
 
   /**
@@ -116,7 +116,7 @@ const TableList: React.FC<{}> = () => {
    * 处理返回值
    * @param res
    */
-  const memoryRes = (res:any)=>{
+  const memoryRes = (res: any) => {
     if (res.success) {
       setState({showBack: false});
       setMemory({...memory, ...res.data});
@@ -154,19 +154,21 @@ const TableList: React.FC<{}> = () => {
       {state.step === Step.MEMORY ? (
         <div>
           问题:
-          <p />
+          <p/>
           <Quill
             readonly
-            onChange={()=>{}}
+            onChange={() => {
+            }}
             value={memory.front}/>
-            <p />
+          <p/>
           {state.showBack ? (
             <div>
               <Quill
                 readonly
-                onChange={()=>{}}
+                onChange={() => {
+                }}
                 value={memory.back}/>
-                <p />
+              <p/>
               <Button
                 type="primary"
                 onClick={() => {
@@ -258,14 +260,16 @@ const TableList: React.FC<{}> = () => {
         </div>
       ) : null}
 
-      <UpdateForm
-        onCancel={()=>{
-          changStepMain();
-        }}
-        modalVisible={state.step === Step.ADD}
-        values={memory}>
+      {state.step === Step.ADD ? (
+        <UpdateForm
+          onCancel={() => {
+            changStepMain();
+          }}
+          modalVisible={state.step === Step.ADD}
+          values={memory}>
+        </UpdateForm>
+      ) : null}
 
-      </UpdateForm>
     </PageHeaderWrapper>
   );
 };