chengjie 6 月之前
父节点
当前提交
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 7
 import mpsRouter from './api/mps/routes.js';
8 8
 import commonRouter from './api/common/routes.js';
9 9
 import { decryptUrlMiddle } from './util/crypto/index.js';
10
+import { stringUtils } from './util/stringClass.js';
10 11
 
11 12
 const __dirname = path.dirname(fileURLToPath(import.meta.url));
12 13
 
@@ -42,5 +43,6 @@ app.use(commonRouter.allowedMethods());
42 43
 
43 44
 // 启动服务器
44 45
 app.listen(config.port, () => {
46
+    console.log('Server IP:', stringUtils.GetServerIP());
45 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());