cgserver 10.0.17 → 10.0.18

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.
@@ -108,5 +108,12 @@ class BaseController {
108
108
  get remoteHost() {
109
109
  return this._request.remoteHost;
110
110
  }
111
+ forceDebug() {
112
+ //静态控制器,传过来全是空
113
+ if (this._request) {
114
+ this._request.debugInfo();
115
+ }
116
+ this._response.debug = true;
117
+ }
111
118
  }
112
119
  exports.BaseController = BaseController;
@@ -8,11 +8,13 @@ class Response {
8
8
  _res = null;
9
9
  _cookie_prefix = "";
10
10
  _cfg = null;
11
+ debug = false;
11
12
  get baseRes() {
12
13
  return this._res;
13
14
  }
14
15
  constructor(res, cfg) {
15
16
  this._cfg = cfg;
17
+ this.debug = this._cfg.debug || false;
16
18
  this._res = res;
17
19
  this._cookie_prefix = this._cfg.cookie.prefix;
18
20
  }
@@ -76,7 +78,7 @@ class Response {
76
78
  });
77
79
  }
78
80
  debugInfo(data) {
79
- if (!this._cfg.debug) {
81
+ if (!this.debug) {
80
82
  return;
81
83
  }
82
84
  Log_1.gLog.info(data);
@@ -30,4 +30,5 @@ export declare class BaseController {
30
30
  redirect(module?: string, controller?: string, action?: string, params?: any): void;
31
31
  parseFullUrl(module: string, controller: string, action: string): string;
32
32
  get remoteHost(): string;
33
+ forceDebug(): void;
33
34
  }
@@ -4,6 +4,7 @@ export declare class Response {
4
4
  protected _res: Express.Response;
5
5
  protected _cookie_prefix: string;
6
6
  protected _cfg: WebServerConfig;
7
+ debug: boolean;
7
8
  get baseRes(): Express.Response<any, Record<string, any>>;
8
9
  constructor(res: Express.Response, cfg: WebServerConfig);
9
10
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "10.0.17",
3
+ "version": "10.0.18",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",