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.
- package/dist/lib/Framework/WebServer/Controller/BaseController.js +7 -0
- package/dist/lib/Framework/WebServer/Engine/Response.js +3 -1
- package/dist/types/Framework/WebServer/Controller/BaseController.d.ts +1 -0
- package/dist/types/Framework/WebServer/Engine/Response.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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.
|
|
81
|
+
if (!this.debug) {
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
84
|
Log_1.gLog.info(data);
|
|
@@ -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
|
/**
|