Browse Source

feat(config): 更新Python应用端口从7074到7075

- 修改electron配置文件中的Python应用启动端口
- 更新前端健康检查接口的默认端口号
- 调整WebSocket连接地址的端口配置
- 统一所有环境下的Python服务监听端口为7075
panqiuyao 1 month ago
parent
commit
1278da307a

+ 1 - 1
electron/api/request.js

@@ -7,7 +7,7 @@ const pyapp = readConfigFile().pyapp
 
 // create an axios instance
 const service = axios.create()
-const baseUrl = 'http://'+pyapp+':7074'
+const baseUrl = 'http://'+pyapp+':7075'
 const basePrefixUrl = 'api'
 const timeout = 600000
 const uploadTimeout = 600000

+ 1 - 1
electron/config/bin.js

@@ -155,7 +155,7 @@ module.exports = {
     python: {
       directory: "./python",
       cmd: "python",
-      args: ["./main.py", "--port=7074"],
+      args: ["./main.py", "--port=7075"],
       stdio: "inherit", // ignore
     },
   },

+ 1 - 1
electron/config/config.default.js

@@ -102,7 +102,7 @@ module.exports = (appInfo) => {
       name: "pyapp",
       cmd: "./py/pyapp",
       directory: "./py",
-      args: ["--port=7074"],
+      args: ["--port=7075"],
       appExit: true,
     },
   };

+ 1 - 1
electron/config/config.local.js

@@ -43,7 +43,7 @@ module.exports = (appInfo) => {
       name: "pyapp",
       cmd: "python",
       directory: "./python",
-      args: ["./main.py", "--port=7074"],
+      args: ["./main.py", "--port=7075"],
       stdio: "ignore",
       appExit: true,
     },

+ 1 - 1
electron/service/cross.js

@@ -99,7 +99,7 @@ class CrossService extends Service {
       name: "pyapp",
       cmd: path.join(Ps.getExtraResourcesDir(), "py", "pyapp"),
       directory: path.join(Ps.getExtraResourcesDir(), "py"),
-      args: ["--port=7074"],
+      args: ["--port=7075"],
       windowsExtname: true,
       appExit: true,
     };

+ 1 - 1
electron/utils/socket.js

@@ -199,7 +199,7 @@ const pySocket = function () {
       this.shouldReconnect = true;
       this.isReconnecting = false;
 
-      app.socket = new WebSocket('ws://'+pyapp+':7074/ws');
+      app.socket = new WebSocket('ws://'+pyapp+':7075/ws');
 
       // 监听连接成功事件
       app.socket.on('open', () => {

+ 1 - 1
frontend/src/views/Home/index.vue

@@ -114,7 +114,7 @@ const goShot = async () => {
 const checkHealth = async () => {
   loading.value = false;
   try {
-    const healthUrl = configInfoStore?.appConfig?.pyapp ? 'http://'+configInfoStore?.appConfig?.pyapp+':7074' :  'http://127.0.0.1:7074'
+    const healthUrl = configInfoStore?.appConfig?.pyapp ? 'http://'+configInfoStore?.appConfig?.pyapp+':7075' :  'http://127.0.0.1:7075'
     const response = await axios.get(healthUrl);
     if (response.status === 200) {
       loading.value = false; // 健康检查成功,关闭 loading