From bfdba3e91f38711249760ccf7740523b21fee137 Mon Sep 17 00:00:00 2001 From: zhaozilong12 <405241463@qq.com> Date: Tue, 29 Jul 2025 17:04:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/config.ini | 2 +- backend/utils.py | 2 +- config.ini | 2 +- config.json | 2 +- frontend/src/main/main.js | 3 +- frontend/src/renderer/src/views/Dashboard.vue | 13 ++- .../src/renderer/src/views/PatientCreate.vue | 2 +- .../src/renderer/src/views/PatientProfile.vue | 10 +- frontend/src/renderer/src/views/Recording.vue | 18 +-- init_test_data.py | 105 ++++++++++++++++++ package.json | 2 +- 11 files changed, 137 insertions(+), 24 deletions(-) create mode 100644 init_test_data.py diff --git a/backend/config.ini b/backend/config.ini index 3a3cfa8b..92b97002 100644 --- a/backend/config.ini +++ b/backend/config.ini @@ -5,7 +5,7 @@ debug = false log_level = INFO [SERVER] -host = 127.0.0.1 +host = 0.0.0.0 port = 5000 cors_origins = * diff --git a/backend/utils.py b/backend/utils.py index a0ed9220..8418cde4 100644 --- a/backend/utils.py +++ b/backend/utils.py @@ -53,7 +53,7 @@ class Config: # 服务器配置 self.config['SERVER'] = { - 'host': '127.0.0.1', + 'host': '0.0.0.0', 'port': '5000', 'cors_origins': '*' } diff --git a/config.ini b/config.ini index ee5d52e0..8d1bf7c0 100644 --- a/config.ini +++ b/config.ini @@ -5,7 +5,7 @@ debug = false log_level = INFO [SERVER] -host = 127.0.0.1 +host = 0.0.0.0 port = 5000 cors_origins = * diff --git a/config.json b/config.json index f9dad1b3..64d8d7e4 100644 --- a/config.json +++ b/config.json @@ -22,7 +22,7 @@ } }, "server": { - "host": "127.0.0.1", + "host": "0.0.0.0", "port": 5000, "debug": false, "cors": { diff --git a/frontend/src/main/main.js b/frontend/src/main/main.js index ac1e93f5..e27cada3 100644 --- a/frontend/src/main/main.js +++ b/frontend/src/main/main.js @@ -7,7 +7,8 @@ const log = require('electron-log'); let mainWindow; let pythonProcess; const BACKEND_PORT = 5000; -const BACKEND_URL = `http://127.0.0.1:${BACKEND_PORT}`; +const BACKEND_HOST = process.env.BACKEND_HOST || '0.0.0.0'; +const BACKEND_URL = `http://${BACKEND_HOST}:${BACKEND_PORT}`; // 配置日志 log.transports.file.resolvePathFn = () => path.join(app.getPath('userData'), 'logs', 'main.log'); diff --git a/frontend/src/renderer/src/views/Dashboard.vue b/frontend/src/renderer/src/views/Dashboard.vue index 197d4735..7b106937 100644 --- a/frontend/src/renderer/src/views/Dashboard.vue +++ b/frontend/src/renderer/src/views/Dashboard.vue @@ -13,7 +13,7 @@ {{ userInfo.username }} - +