chengjie 8 ヶ月 前
コミット
d03ebbe27b
共有3 個のファイルを変更した10 個の追加1 個の削除を含む
  1. 3 1
      src/api/common/commonController.js
  2. 2 0
      src/app.js
  3. 5 0
      src/test/stringClass.test.js

+ 3 - 1
src/api/common/commonController.js

@@ -189,4 +189,6 @@ async function uploadFile(filename, filepath) {
189
             }
189
             }
190
         });
190
         });
191
     });
191
     });
192
-}
192
+}
193
+
194
+

+ 2 - 0
src/app.js

@@ -7,6 +7,7 @@ import config from './config/index.js';
7
 import mpsRouter from './api/mps/routes.js';
7
 import mpsRouter from './api/mps/routes.js';
8
 import commonRouter from './api/common/routes.js';
8
 import commonRouter from './api/common/routes.js';
9
 import { decryptUrlMiddle } from './util/crypto/index.js';
9
 import { decryptUrlMiddle } from './util/crypto/index.js';
10
+import { stringUtils } from './util/stringClass.js';
10
 
11
 
11
 const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
 const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
 
13
 
@@ -42,5 +43,6 @@ app.use(commonRouter.allowedMethods());
42
 
43
 
43
 // 启动服务器
44
 // 启动服务器
44
 app.listen(config.port, () => {
45
 app.listen(config.port, () => {
46
+    console.log('Server IP:', stringUtils.GetServerIP());
45
     console.log(`Server running on port ${config.port}`);
47
     console.log(`Server running on port ${config.port}`);
46
 });
48
 });

+ 5 - 0
src/test/stringClass.test.js

@@ -0,0 +1,5 @@
1
+'use strict';
2
+import { stringUtils } from '../util/stringClass.js';
3
+
4
+// 测试获取服务器IP
5
+console.log('Server IP:', stringUtils.GetServerIP());