mm_os 2.1.4 → 2.1.5

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.
@@ -26,10 +26,10 @@ class Drive extends Item {
26
26
  constructor(dir) {
27
27
  super(dir, __dirname);
28
28
  this.default_file = "./api.json";
29
-
29
+
30
30
  this.save_dir = './static/file/';
31
31
  this.url_path = "./file/";
32
-
32
+
33
33
  // oauth身份验证配置 + 函数
34
34
  this.oauth;
35
35
  // param参数配置 + 函数
@@ -268,6 +268,12 @@ Drive.prototype.loadSql = async function(file_path) {
268
268
  this.sql.load(p);
269
269
  this.setSql(this.sql);
270
270
  }
271
+ if (this.sql && this.param && this.param.config) {
272
+ var list = this.param.config.list;
273
+ if (list && list.length) {
274
+ this.sql.params = list;
275
+ }
276
+ }
271
277
  }
272
278
  };
273
279
 
@@ -334,7 +340,7 @@ Drive.prototype.save_file = function(files) {
334
340
  file.addDir();
335
341
  // 创建写入流
336
342
  var readStream = fs.createReadStream(f.filepath);
337
-
343
+
338
344
  try {
339
345
  const writeStream = fs.createWriteStream(file);
340
346
  readStream.pipe(writeStream);
@@ -21,6 +21,7 @@ class Drive extends Item {
21
21
  this.url_path = "/file/";
22
22
 
23
23
  /* 通用项 */
24
+ this.params = null;
24
25
  // 配置参数
25
26
  this.config = {
26
27
  // 名称, 由中英文和下“_”组成, 用于修改或卸载 例如: demo
@@ -566,6 +567,9 @@ Drive.prototype.get_params = async function(db, fields) {
566
567
  if (cg.params) {
567
568
  return cg.params;
568
569
  }
570
+ if (this.params) {
571
+ return this.params;
572
+ }
569
573
  var lt = [];
570
574
  if ($.pool.db) {
571
575
  var pool = $.pool.db['sys'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_os",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "这是超级美眉服务端框架,用于快速构建应用程序。",
5
5
  "main": "index.js",
6
6
  "scripts": {