mm_os 1.5.5 → 1.5.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/core/com/api/drive.js +5 -3
- package/core/com/sql/drive.js +9 -3
- package/package.json +1 -1
package/core/com/api/drive.js
CHANGED
|
@@ -328,7 +328,6 @@ Drive.prototype.save_file = function(files) {
|
|
|
328
328
|
if (files.file) {
|
|
329
329
|
var f = files.file;
|
|
330
330
|
// 创建可读流
|
|
331
|
-
const readStream = fs.createReadStream(f.path);
|
|
332
331
|
var stamp = Date.now();
|
|
333
332
|
var name = f.name;
|
|
334
333
|
file = path.join($.runPath, dir, name);
|
|
@@ -375,7 +374,10 @@ $.get_state = async function(db, token) {
|
|
|
375
374
|
o.password = o.password ? "******" : "";
|
|
376
375
|
delete o.salt;
|
|
377
376
|
delete o.time_create;
|
|
378
|
-
return {
|
|
377
|
+
return {
|
|
378
|
+
state,
|
|
379
|
+
user: o
|
|
380
|
+
};
|
|
379
381
|
} else {
|
|
380
382
|
return null;
|
|
381
383
|
}
|
|
@@ -714,4 +716,4 @@ Drive.prototype.runRPC = async function(db, method, query, body) {
|
|
|
714
716
|
return ret;
|
|
715
717
|
};
|
|
716
718
|
|
|
717
|
-
module.exports = Drive;
|
|
719
|
+
module.exports = Drive;
|
package/core/com/sql/drive.js
CHANGED
|
@@ -18,9 +18,9 @@ class Drive extends Item {
|
|
|
18
18
|
super(dir, __dirname);
|
|
19
19
|
this.default_file = "./sql.json";
|
|
20
20
|
// 保存文件目录
|
|
21
|
-
this.save_dir = '/static/
|
|
21
|
+
this.save_dir = '/static/file/';
|
|
22
22
|
// 读取文件目录
|
|
23
|
-
this.url_path = "/
|
|
23
|
+
this.url_path = "/file/";
|
|
24
24
|
|
|
25
25
|
/* 通用项 */
|
|
26
26
|
// 配置参数
|
|
@@ -623,7 +623,13 @@ Drive.prototype.get_format = async function(db) {
|
|
|
623
623
|
if (o.table) {
|
|
624
624
|
if (!o.list || o.list.length == 0) {
|
|
625
625
|
dbs.table = o.table;
|
|
626
|
-
|
|
626
|
+
var list = await dbs.getSql(o.where, null, o.id + "," + o.name);
|
|
627
|
+
if (o.id !== o.key) {
|
|
628
|
+
o.list = list.map((m) => {
|
|
629
|
+
m[o.key] = m[o.id];
|
|
630
|
+
return m;
|
|
631
|
+
});
|
|
632
|
+
}
|
|
627
633
|
}
|
|
628
634
|
}
|
|
629
635
|
}
|