cgserver 8.6.4 → 8.6.6

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,6 @@
1
- 8.6.12
1
+ 8.6.6
2
+ 1、SyncCall2 this丢失的bug修正
3
+ 8.6.2
2
4
  1、C# post url-encoded data support
3
5
  8.6.1
4
6
  1、quickTrasaction support options
@@ -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
  };
@@ -59,6 +59,15 @@ class Request {
59
59
  break;
60
60
  }
61
61
  }
62
+ if (Core_1.core.isString(body)) {
63
+ try {
64
+ body = JSON.parse(body);
65
+ }
66
+ catch (e) {
67
+ Log_1.GLog.error("post data--" + body + "--parse error");
68
+ body = {};
69
+ }
70
+ }
62
71
  // 暂时去掉强制数值转换
63
72
  // //服务器会有一层空key的json解析
64
73
  // for(let k in body)
@@ -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.4",
3
+ "version": "8.6.6",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",