From 5828176158639855c5901536e169c0a37c964254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E8=AA=89=E7=A8=8B?= <2659568239@qq.com> Date: Thu, 22 Feb 2024 10:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodeService.js | 10 +--------- src/pages/InitialSystem/PowerOnAuth/index.tsx | 2 +- src/pages/InstallExe/exeDialog/CodeManage.tsx | 2 +- src/pages/InstallExe/exeDialog/CoreArea.tsx | 2 +- src/pages/InstallExe/exeDialog/DutyArea.tsx | 2 +- src/utils/env/dev.ts | 2 +- 6 files changed, 6 insertions(+), 14 deletions(-) diff --git a/nodeService.js b/nodeService.js index 9f0ca8a..9bd2022 100644 --- a/nodeService.js +++ b/nodeService.js @@ -5,7 +5,7 @@ const cors = require('cors'); const bodyParser = require('body-parser'); const app = express(); -const port = 8081; // 可以根据需要修改端口号 +const port = 3000; // 可以根据需要修改端口号 app.use(cors()); app.use(bodyParser.json()); @@ -46,14 +46,6 @@ app.post('/createShortcut', (req, res) => { }); }); -// 静态文件服务,指定 dist 目录为静态文件目录 -app.use(express.static(path.join(__dirname, 'dist'))); - -// 所有请求都返回 index.html 文件,让前端路由处理页面跳转 -app.get('*', function(req, res) { - res.sendFile(path.join(__dirname, 'dist', 'index.html')); -}); - // 运行项目 需要进入到当前的文件夹目录打开终端 执行 node nodeService.js app.listen(port, () => { console.log(`Server is running on port ${port}`); diff --git a/src/pages/InitialSystem/PowerOnAuth/index.tsx b/src/pages/InitialSystem/PowerOnAuth/index.tsx index 84c7614..36b8598 100644 --- a/src/pages/InitialSystem/PowerOnAuth/index.tsx +++ b/src/pages/InitialSystem/PowerOnAuth/index.tsx @@ -60,7 +60,7 @@ const PowerOnAuth: FC = ({ }) => { // 在指定的目录下安装快捷方式 const installSuccess = async () => { try { - const response = await fetch('http://127.0.0.1:8081/createShortcut', { + const response = await fetch('http://127.0.0.1:3000/createShortcut', { method: 'POST', headers: { 'Content-Type': 'application/json' }, mode: "cors", diff --git a/src/pages/InstallExe/exeDialog/CodeManage.tsx b/src/pages/InstallExe/exeDialog/CodeManage.tsx index 27de7be..42c567f 100644 --- a/src/pages/InstallExe/exeDialog/CodeManage.tsx +++ b/src/pages/InstallExe/exeDialog/CodeManage.tsx @@ -59,7 +59,7 @@ const CodeManage: FC = ({ // 在指定的目录下安装快捷方式 const installSuccess = async () => { try { - const response = await fetch('http://127.0.0.1:8081/createShortcut', { + const response = await fetch('http://127.0.0.1:3000/createShortcut', { method: 'POST', headers: { 'Content-Type': 'application/json' }, mode: "cors", diff --git a/src/pages/InstallExe/exeDialog/CoreArea.tsx b/src/pages/InstallExe/exeDialog/CoreArea.tsx index 99fbd69..fb4a8a9 100644 --- a/src/pages/InstallExe/exeDialog/CoreArea.tsx +++ b/src/pages/InstallExe/exeDialog/CoreArea.tsx @@ -69,7 +69,7 @@ const CoreArea: FC = ({ // 在指定的目录下安装快捷方式 const installSuccess = async () => { try { - const response = await fetch('http://127.0.0.1:8081/createShortcut', { + const response = await fetch('http://127.0.0.1:3000/createShortcut', { method: 'POST', headers: { 'Content-Type': 'application/json' }, mode: "cors", diff --git a/src/pages/InstallExe/exeDialog/DutyArea.tsx b/src/pages/InstallExe/exeDialog/DutyArea.tsx index 76aeeca..e1dd3f5 100644 --- a/src/pages/InstallExe/exeDialog/DutyArea.tsx +++ b/src/pages/InstallExe/exeDialog/DutyArea.tsx @@ -69,7 +69,7 @@ const DutyArea: FC = ({ // 在指定的目录下安装快捷方式 const installSuccess = async () => { try { - const response = await fetch('http://127.0.0.1:8081/createShortcut', { + const response = await fetch('http://127.0.0.1:3000/createShortcut', { method: 'POST', headers: { 'Content-Type': 'application/json' }, mode: "cors", diff --git a/src/utils/env/dev.ts b/src/utils/env/dev.ts index ebf8cd4..7c2e493 100644 --- a/src/utils/env/dev.ts +++ b/src/utils/env/dev.ts @@ -6,7 +6,7 @@ export const DEV = { // 更新到线上屏蔽上面内容开放下面内容 PROXY_SERVER: 'http://127.0.0.1:8088', - LOCAL_URL: 'http://127.0.0.1:8081', + LOCAL_URL: 'http://127.0.0.1:8000', FILE_URL: '/home/headless/Desktop', HARD_CODE: true, };