@ticatec/common-express-server 0.0.6 → 0.0.8

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.
@@ -1,8 +1,8 @@
1
- import { Express } from "express";
1
+ import { Express, Router } from "express";
2
2
  import CommonRouterHelper from "./CommonRouterHelper";
3
3
  import { Logger } from "log4js";
4
4
  export default abstract class CommonRoutes {
5
- readonly router: any;
5
+ readonly router: Router;
6
6
  protected helper: CommonRouterHelper;
7
7
  protected logger: Logger;
8
8
  protected constructor(helper: CommonRouterHelper, checkUser?: boolean);
@@ -12,7 +12,7 @@ class CommonRoutes {
12
12
  this.logger = log4js_1.default.getLogger(this.constructor.name);
13
13
  if (checkUser) {
14
14
  this.logger.debug('检查用户是否登录');
15
- this.router.all('/*', helper.checkLoggedUser());
15
+ this.router.use(helper.checkLoggedUser());
16
16
  }
17
17
  }
18
18
  bindRouter(app, path) {
@@ -1 +1 @@
1
- {"version":3,"file":"CommonRoutes.js","sourceRoot":"src/","sources":["CommonRoutes.ts"],"names":[],"mappings":";;;;;AAAA,qCAAwC;AAExC,oDAAsC;AAEtC,MAA8B,YAAY;IAKtC,YAAsB,MAA0B,EAAE,YAAqB,IAAI;QACvE,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,gBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,SAAS,EAAE;YACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC;SACnD;IACL,CAAC;IAED,UAAU,CAAC,GAAY,EAAE,IAAY;QACjC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACJ;AAlBD,+BAkBC"}
1
+ {"version":3,"file":"CommonRoutes.js","sourceRoot":"src/","sources":["CommonRoutes.ts"],"names":[],"mappings":";;;;;AAAA,qCAAwC;AAExC,oDAAsC;AAEtC,MAA8B,YAAY;IAKtC,YAAsB,MAA0B,EAAE,YAAqB,IAAI;QACvE,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,gBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,SAAS,EAAE;YACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC;SAC7C;IACL,CAAC;IAED,UAAU,CAAC,GAAY,EAAE,IAAY;QACjC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACJ;AAlBD,+BAkBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/common-express-server",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "A set of common classes for node express apps.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",