@less-is-more/less-js 1.4.26-2 → 1.4.26-4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/router.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@less-is-more/less-js",
3
- "version": "1.4.26-2",
3
+ "version": "1.4.26-4",
4
4
  "description": "Fast develop kit for nodejs",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/router.js CHANGED
@@ -106,16 +106,16 @@ module.exports = class Router {
106
106
  const data = await promisify(body)(req);
107
107
  if (!Param.isBlank(data)) {
108
108
  try {
109
- req.sourceBody = data;
110
- req.body = JSON.parse(data);
109
+ req.sourceBody = data.toString();
110
+ req.body = JSON.parse(data.toString());
111
111
  } catch (e) {
112
112
  console.warn("body格式错误", data);
113
113
  }
114
114
  }
115
115
  } else {
116
116
  const data = await promisify(body)(req);
117
- req.sourceBody = data;
118
- req.body = qs.parse(data);
117
+ req.sourceBody = decodeURIComponent(data.toString());
118
+ req.body = qs.parse(data.toString());
119
119
  }
120
120
  }
121
121
  if (req.params == undefined) {