cgserver 8.9.5 → 8.9.7

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/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ 8.9.6
2
+ 1、webview的view可配置
1
3
  8.9.4
2
4
  1、扩展签名和验签功能
3
5
  8.6.9
@@ -87,6 +87,11 @@ class Engine {
87
87
  let req = new Request_1.Request(_req, this._cfg);
88
88
  let res = new Response_1.Response(_res, this._cfg);
89
89
  let method = req.method.toLowerCase();
90
+ if (method == "head") {
91
+ _res.status(200).send("");
92
+ Log_1.GLog.info(_res);
93
+ return;
94
+ }
90
95
  if (method != "get" && method != "post") {
91
96
  return;
92
97
  }
@@ -128,11 +133,11 @@ class Engine {
128
133
  stop() {
129
134
  }
130
135
  getRenderHtml(req, res, datas) {
131
- let tmpl = "view/" + req.controller.toLowerCase() + "/" + req.action.toLowerCase();
132
- //if(!this._cfg.routs.onlyModule)
133
- {
134
- tmpl = "modules/" + req.module.toLowerCase() + "/" + tmpl;
136
+ let rootview = this._cfg.rootview || "view";
137
+ if (!rootview.endsWith("/")) {
138
+ rootview += "/";
135
139
  }
140
+ let tmpl = rootview + req.controller.toLowerCase() + "/" + req.action.toLowerCase();
136
141
  let html = this._getRenderHtml(req, res, tmpl, datas);
137
142
  return html;
138
143
  }
@@ -18,5 +18,5 @@ export declare class Engine {
18
18
  protected _all(_req: Express.Request, _res: Express.Response): Promise<void>;
19
19
  stop(): void;
20
20
  getRenderHtml(req: Request, res: Response, datas: any): any;
21
- protected _getRenderHtml(req: Request, res: Response, tmpl: any, params: any): any;
21
+ protected _getRenderHtml(req: Request, res: Response, tmpl: string, params: any): any;
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "8.9.5",
3
+ "version": "8.9.7",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",