cgserver 14.0.1 → 14.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,13 +38,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.core = void 0;
|
|
40
40
|
let os = require('os');
|
|
41
|
-
let request = require('request');
|
|
42
41
|
const _ = __importStar(require("underscore"));
|
|
43
42
|
const crypto = __importStar(require("crypto"));
|
|
44
43
|
const CryptoJS = __importStar(require("crypto-js"));
|
|
45
44
|
const ec_key_1 = __importDefault(require("ec-key"));
|
|
46
45
|
const uuid_1 = require("uuid");
|
|
47
46
|
const Log_1 = require("../Logic/Log");
|
|
47
|
+
const axios_1 = __importDefault(require("axios"));
|
|
48
48
|
/**
|
|
49
49
|
* 一些通用的常用函数,
|
|
50
50
|
* 比如格式化字符串,常用加解密,
|
|
@@ -395,15 +395,12 @@ class core {
|
|
|
395
395
|
};
|
|
396
396
|
static getIP = async function () {
|
|
397
397
|
return new Promise((resolve, reject) => {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
console.error("can not get correct ip!");
|
|
405
|
-
resolve(null);
|
|
406
|
-
}
|
|
398
|
+
axios_1.default.get('http://ip.chinaz.com/getip.aspx').then(response => {
|
|
399
|
+
let body = response.data;
|
|
400
|
+
resolve(body.ip);
|
|
401
|
+
}).catch(error => {
|
|
402
|
+
console.error("can not get correct ip!");
|
|
403
|
+
resolve(null);
|
|
407
404
|
});
|
|
408
405
|
});
|
|
409
406
|
};
|