@domain.js/main 0.4.13 → 0.4.15

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) => {
@@ -363,6 +363,7 @@ function Utils(cnf, deps) {
363
363
  // 返回列表查询的条件
364
364
  const findAllOpts = (Model, params) => {
365
365
  const { Op } = Sequelize;
366
+ const { literal } = Model.sequelize;
366
367
  const where = {};
367
368
  const searchOrs = [];
368
369
  const includes = modelInclude(params, Model.includes);
@@ -410,14 +411,14 @@ function Utils(cnf, deps) {
410
411
  const _searchOrs = _.filter(_.compact(searchOrs), (x) => x.length);
411
412
  if (_.size(where)) {
412
413
  if (_searchOrs.length) {
413
- ret.where = Sequelize.and(where, Sequelize.literal(mergeSearchOrs(_searchOrs)));
414
+ ret.where = Sequelize.and(where, literal(mergeSearchOrs(_searchOrs)));
414
415
  }
415
416
  else {
416
417
  ret.where = where;
417
418
  }
418
419
  }
419
420
  else if (_searchOrs.length) {
420
- ret.where = Sequelize.literal(mergeSearchOrs(_searchOrs));
421
+ ret.where = literal(mergeSearchOrs(_searchOrs));
421
422
  }
422
423
  // 处理需要返回的字段
423
424
  (() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domain.js/main",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "description": "DDD framework",
5
5
  "main": "dist/index.js",
6
6
  "bin": {