cgserver 8.6.1 → 8.6.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.
package/README.md CHANGED
@@ -1,2 +1,4 @@
1
+ 8.6.12
2
+ 1、C# post url-encoded data support
1
3
  8.6.1
2
4
  1、quickTrasaction support options
@@ -53,19 +53,32 @@ class Request {
53
53
  }
54
54
  get postData() {
55
55
  var body = this._req.body || {};
56
- //服务器会有一层空key的json解析
57
- for (let k in body) {
58
- var v = body[k];
59
- if (!Core_1.core.isString(v)) {
60
- continue;
61
- }
62
- if (parseInt(v) == v) {
63
- body[k] = parseInt(v);
64
- }
65
- else if (parseFloat(v) == v) {
66
- body[k] == parseFloat(v);
67
- }
68
- }
56
+ //特殊处理C#的post x-www-form-urlencoded 数据,这个数据很奇怪会把整体数据作为一个key,然后value为空字符串
57
+ let keys = Object.keys(body);
58
+ if (keys.length == 1
59
+ && body[keys[0]] == ""
60
+ && Core_1.core.isObject(keys[0])) {
61
+ body = keys[0];
62
+ }
63
+ // 暂时去掉强制数值转换
64
+ // //服务器会有一层空key的json解析
65
+ // for(let k in body)
66
+ // {
67
+ // var v = body[k]
68
+ // if(!core.isString(v))
69
+ // {
70
+ // continue
71
+ // }
72
+ // let intv = parseInt(v)
73
+ // if(intv==v)
74
+ // {
75
+ // body[k]=intv
76
+ // }
77
+ // else if(parseFloat(v)==v)
78
+ // {
79
+ // body[k]==parseFloat(v)
80
+ // }
81
+ // }
69
82
  return body;
70
83
  }
71
84
  get url() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "8.6.1",
3
+ "version": "8.6.2",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",