@domain.js/main 0.4.14 → 0.4.16

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.
@@ -33,15 +33,7 @@ function Main(cnf, deps) {
33
33
  const dir = path_1.default.resolve(errorLogPath, today);
34
34
  makeDir(dir);
35
35
  const file = path_1.default.resolve(dir, `${code}.err`);
36
- const content = [time, clientId, e.message];
37
- if (e.data) {
38
- try {
39
- content.push(JSON.stringify(e.data));
40
- }
41
- catch (err) {
42
- content.push((0, util_1.format)(e.data));
43
- }
44
- }
36
+ const content = [time, clientId, (0, util_1.format)(e)];
45
37
  if (extra !== null || extra !== undefined) {
46
38
  try {
47
39
  content.push(JSON.stringify(extra));
@@ -50,8 +42,8 @@ function Main(cnf, deps) {
50
42
  content.push((0, util_1.format)(extra));
51
43
  }
52
44
  }
53
- if (e.stack)
54
- content.push(JSON.stringify(e.stack));
45
+ if (!e.stack)
46
+ content.push((0, util_1.format)(Error()));
55
47
  promises_1.default.appendFile(file, `${content.join("\t")}\n`).catch(console.error);
56
48
  };
57
49
  const info = (message, extra) => {
@@ -6,6 +6,7 @@ export interface Cnf {
6
6
  bodyMaxBytes?: number;
7
7
  apisRoute?: string;
8
8
  socket?: boolean;
9
+ fileUploadMultiple?: boolean;
9
10
  [propName: string]: any;
10
11
  }
11
12
  export interface Profile {
@@ -32,7 +32,8 @@ function Main(cnf, deps) {
32
32
  server.use(restify.plugins.queryParser());
33
33
  server.use(restify.plugins.bodyParser({
34
34
  keepExtensions: true,
35
- maxFieldsSize: cnf.bodyMaxBytes || 2 * 1024 * 1024, // 参数最大容量 2MB
35
+ maxFieldsSize: cnf.bodyMaxBytes || 2 * 1024 * 1024,
36
+ multiples: cnf.fileUploadMultiple || false, // 是否支持多文件上传
36
37
  }));
37
38
  const router = (0, router_1.Router)({
38
39
  utils,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domain.js/main",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "description": "DDD framework",
5
5
  "main": "dist/index.js",
6
6
  "bin": {