cgserver 8.9.4 → 8.9.6

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
@@ -34,6 +34,7 @@ class WebServerConfig {
34
34
  //默认不跨域
35
35
  cors = null;
36
36
  static = null;
37
+ rootview = "";
37
38
  }
38
39
  exports.WebServerConfig = WebServerConfig;
39
40
  class FrameworkConfig extends Config_1.Config {
@@ -128,11 +128,11 @@ class Engine {
128
128
  stop() {
129
129
  }
130
130
  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;
131
+ let rootview = this._cfg.rootview || "view";
132
+ if (!rootview.endsWith("/")) {
133
+ rootview += "/";
135
134
  }
135
+ let tmpl = rootview + req.controller.toLowerCase() + "/" + req.action.toLowerCase();
136
136
  let html = this._getRenderHtml(req, res, tmpl, datas);
137
137
  return html;
138
138
  }
@@ -44,6 +44,7 @@ export declare class WebServerConfig {
44
44
  route: string;
45
45
  path: string;
46
46
  }[];
47
+ rootview: string;
47
48
  }
48
49
  export declare class FrameworkConfig extends Config {
49
50
  console_level: number;
@@ -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.4",
3
+ "version": "8.9.6",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",