cgserver 8.6.5 → 8.6.7

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/README.md CHANGED
@@ -1,4 +1,8 @@
1
- 8.6.12
1
+ 8.6.7
2
+ 1、getAutoIds bug修改
3
+ 8.6.6
4
+ 1、SyncCall2 this丢失的bug修正
5
+ 8.6.2
2
6
  1、C# post url-encoded data support
3
7
  8.6.1
4
8
  1、quickTrasaction support options
@@ -116,13 +116,10 @@ class MongoManager {
116
116
  try {
117
117
  let where = this._convertWhere({ _id: key });
118
118
  let rs = await Core_1.core.safeCall(col.findOneAndUpdate, col, where, { $inc: { id: 1 } }, { upsert: true });
119
- if (rs.ok) {
120
- if (rs.value) {
121
- return rs.value.id + 1;
122
- }
123
- return 0 + 1;
119
+ if (rs.id) {
120
+ return rs.id + 1;
124
121
  }
125
- return -1;
122
+ return 1;
126
123
  }
127
124
  catch (e) {
128
125
  Log_1.GLog.error(e.stack);
@@ -27,12 +27,13 @@ function SyncCall2(param_index) {
27
27
  return (target, propertyName, descriptor) => {
28
28
  let method = descriptor.value;
29
29
  descriptor.value = function () {
30
+ let self = this;
30
31
  let key = propertyName;
31
32
  if (param_index != undefined && param_index < arguments.length) {
32
33
  key = propertyName + "_" + arguments[param_index];
33
34
  }
34
35
  let ret = SyncQueueTool_1.GSyncQueueTool.add(key, async () => {
35
- return await method.apply(target, arguments);
36
+ return await method.apply(self, arguments);
36
37
  });
37
38
  return ret;
38
39
  };
@@ -8,14 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const Framework_1 = require("../Framework");
10
10
  class Test {
11
- test() {
12
- console.log("test");
11
+ test(str) {
12
+ console.log(str + ":test");
13
13
  }
14
14
  }
15
15
  __decorate([
16
- Framework_1.SyncCall
16
+ (0, Framework_1.SyncCall2)(0)
17
17
  ], Test.prototype, "test", null);
18
18
  let test = new Test();
19
- test.test();
19
+ test.test("111");
20
20
  let str = Framework_1.core.format(Date.now(), "yyyy-MM-dd hh:mm:ss");
21
21
  console.log(str);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "8.6.5",
3
+ "version": "8.6.7",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",