From 9f08245b6dee52a45a233cc90e604db278ea816f Mon Sep 17 00:00:00 2001 From: whyour Date: Thu, 10 Mar 2022 22:37:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=88=9D=E5=A7=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .umirc.ts | 4 ++++ package.json | 2 ++ src/pages/setting/index.tsx | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.umirc.ts b/.umirc.ts index 16204613..e8c58209 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -16,6 +16,10 @@ export default defineConfig({ }, favicon: '/images/g5.ico', proxy: { + '/api/public': { + target: 'http://127.0.0.1:5400/', + changeOrigin: true, + }, '/api': { target: 'http://127.0.0.1:5600/', changeOrigin: true, diff --git a/package.json b/package.json index da65f87e..6376fd46 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,12 @@ "start": "concurrently -n w: npm:start:*", "start:front": "umi dev", "start:back": "nodemon", + "start:public": "ts-node back/public.ts", "build:front": "umi build", "build:back": "tsc -p tsconfig.back.json", "panel": "npm run build:back && node static/build/app.js", "schedule": "npm run build:back && node static/build/schedule.js", + "public": "npm run build:back && node static/build/public.js", "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", "prepare": "umi generate tmp", "test": "umi-test", diff --git a/src/pages/setting/index.tsx b/src/pages/setting/index.tsx index 7894375e..36131352 100644 --- a/src/pages/setting/index.tsx +++ b/src/pages/setting/index.tsx @@ -120,7 +120,7 @@ const Setting = ({ const [theme, setTheme] = useState(defaultDarken); const [dataSource, setDataSource] = useState([]); const [isModalVisible, setIsModalVisible] = useState(false); - const [editedApp, setEditedApp] = useState(); + const [editedApp, setEditedApp] = useState(); const [tabActiveKey, setTabActiveKey] = useState('security'); const [loginLogData, setLoginLogData] = useState([]); const [notificationInfo, setNotificationInfo] = useState(); @@ -143,6 +143,7 @@ const Setting = ({ }; const addApp = () => { + setEditedApp(null); setIsModalVisible(true); };