cgserver 6.2.1 → 6.2.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.
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.core = void 0;
4
4
  let os = require('os');
5
5
  let request = require('request');
6
- const CryptoJS = require("crypto-js");
7
6
  const _ = require("underscore");
7
+ const crypto = require("crypto");
8
8
  /**
9
9
  * 常用的工具函数类
10
10
  */
@@ -322,17 +322,13 @@ class core {
322
322
  return newStr;
323
323
  }
324
324
  static md5(str) {
325
- let md5_str = CryptoJS.MD5(str).toString(CryptoJS.enc.Hex);
325
+ let md5_str = crypto.createHash('md5').update(str).digest('hex');
326
326
  return md5_str;
327
327
  }
328
328
  static sha1(str) {
329
- let sha1_str = CryptoJS.SHA1(str).toString(CryptoJS.enc.Hex);
329
+ let sha1_str = crypto.createHash('sha1').update(str).digest('hex');
330
330
  return sha1_str;
331
331
  }
332
- static sha3(str) {
333
- let sha3_str = CryptoJS.SHA3(str).toString(CryptoJS.enc.Hex);
334
- return sha3_str;
335
- }
336
332
  static getLocalIP = function () {
337
333
  let iptable = {};
338
334
  let ifaces = os.networkInterfaces();
@@ -72,7 +72,7 @@ class BaseService {
72
72
  return rs;
73
73
  }
74
74
  aggregate(pipeline, options) {
75
- let ret = MongoManager_1.GMongoMgr.aggregate(this._table);
75
+ let ret = MongoManager_1.GMongoMgr.aggregate(this._table, pipeline, options);
76
76
  return ret;
77
77
  }
78
78
  }
@@ -40,7 +40,6 @@ export declare class core {
40
40
  static fuzzy(str: string): string;
41
41
  static md5(str: string): string;
42
42
  static sha1(str: string): string;
43
- static sha3(str: string): string;
44
43
  static getLocalIP: () => any;
45
44
  static getIP: () => Promise<string>;
46
45
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",
@@ -33,7 +33,6 @@
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",
37
36
  "@types/express": "^4.17.13",
38
37
  "@types/formidable": "^2.0.0",
39
38
  "@types/mime": "^2.0.3",
@@ -52,7 +51,6 @@
52
51
  "colors": "^1.4.0",
53
52
  "cookie-parser": "^1.4.5",
54
53
  "cors": "^2.8.5",
55
- "crypto-js": "^4.1.1",
56
54
  "ec-key": "0.0.4",
57
55
  "express": "^4.17.1",
58
56
  "fast-xml-parser": "^3.21.1",