cgserver 6.1.8 → 6.2.1
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.
package/dist/lib/Core/Core.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.core = void 0;
|
|
4
|
-
let Md5 = require("md5");
|
|
5
4
|
let os = require('os');
|
|
6
5
|
let request = require('request');
|
|
6
|
+
const CryptoJS = require("crypto-js");
|
|
7
7
|
const _ = require("underscore");
|
|
8
8
|
/**
|
|
9
9
|
* 常用的工具函数类
|
|
@@ -321,13 +321,18 @@ class core {
|
|
|
321
321
|
newStr += last;
|
|
322
322
|
return newStr;
|
|
323
323
|
}
|
|
324
|
-
static md5
|
|
325
|
-
let
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
324
|
+
static md5(str) {
|
|
325
|
+
let md5_str = CryptoJS.MD5(str).toString(CryptoJS.enc.Hex);
|
|
326
|
+
return md5_str;
|
|
327
|
+
}
|
|
328
|
+
static sha1(str) {
|
|
329
|
+
let sha1_str = CryptoJS.SHA1(str).toString(CryptoJS.enc.Hex);
|
|
330
|
+
return sha1_str;
|
|
331
|
+
}
|
|
332
|
+
static sha3(str) {
|
|
333
|
+
let sha3_str = CryptoJS.SHA3(str).toString(CryptoJS.enc.Hex);
|
|
334
|
+
return sha3_str;
|
|
335
|
+
}
|
|
331
336
|
static getLocalIP = function () {
|
|
332
337
|
let iptable = {};
|
|
333
338
|
let ifaces = os.networkInterfaces();
|
|
@@ -299,14 +299,14 @@ class MongoManager {
|
|
|
299
299
|
money = true;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
if (money) {
|
|
302
|
+
if (!money) {
|
|
303
303
|
updatemodel = { "$set": model };
|
|
304
304
|
}
|
|
305
305
|
else {
|
|
306
306
|
updatemodel = model;
|
|
307
307
|
}
|
|
308
308
|
let col = this._mongo.collection(collection);
|
|
309
|
-
up_rs = await col.updateOne(where,
|
|
309
|
+
up_rs = await col.updateOne(where, updatemodel, { upsert: upsert });
|
|
310
310
|
}
|
|
311
311
|
catch (e) {
|
|
312
312
|
Log_1.GLog.error(e.stack);
|
|
@@ -38,7 +38,9 @@ export declare class core {
|
|
|
38
38
|
* @param str
|
|
39
39
|
*/
|
|
40
40
|
static fuzzy(str: string): string;
|
|
41
|
-
static md5
|
|
41
|
+
static md5(str: string): string;
|
|
42
|
+
static sha1(str: string): string;
|
|
43
|
+
static sha3(str: string): string;
|
|
42
44
|
static getLocalIP: () => any;
|
|
43
45
|
static getIP: () => Promise<string>;
|
|
44
46
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cgserver",
|
|
3
|
-
"version": "6.1
|
|
3
|
+
"version": "6.2.1",
|
|
4
4
|
"author": "trojan",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "free for all.Websocket or Http",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@alicloud/sms-sdk": "^1.1.6",
|
|
34
34
|
"@types/cookie-parser": "^1.4.2",
|
|
35
35
|
"@types/cors": "^2.8.12",
|
|
36
|
+
"@types/crypto-js": "^4.1.1",
|
|
36
37
|
"@types/express": "^4.17.13",
|
|
37
38
|
"@types/formidable": "^2.0.0",
|
|
38
|
-
"@types/md5": "^2.3.1",
|
|
39
39
|
"@types/mime": "^2.0.3",
|
|
40
40
|
"@types/mssql": "^7.1.5",
|
|
41
41
|
"@types/mysql": "^2.15.19",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"colors": "^1.4.0",
|
|
53
53
|
"cookie-parser": "^1.4.5",
|
|
54
54
|
"cors": "^2.8.5",
|
|
55
|
+
"crypto-js": "^4.1.1",
|
|
55
56
|
"ec-key": "0.0.4",
|
|
56
57
|
"express": "^4.17.1",
|
|
57
58
|
"fast-xml-parser": "^3.21.1",
|
|
@@ -61,7 +62,6 @@
|
|
|
61
62
|
"https": "^1.0.0",
|
|
62
63
|
"jsonc": "^2.0.0",
|
|
63
64
|
"log4js": "^6.3.0",
|
|
64
|
-
"md5": "^2.3.0",
|
|
65
65
|
"mime": "^3.0.0",
|
|
66
66
|
"mongodb": "^4.2.1",
|
|
67
67
|
"mssql": "^8.0.2",
|
|
@@ -80,7 +80,5 @@
|
|
|
80
80
|
"webpack": "^5.73.0",
|
|
81
81
|
"webpack-node-externals": "^3.0.0",
|
|
82
82
|
"websocket": "^1.0.34"
|
|
83
|
-
},
|
|
84
|
-
"devDependencies": {
|
|
85
83
|
}
|
|
86
84
|
}
|