@xuda.io/drive_module 1.1.562 → 1.1.564
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/index.js +7 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1537,6 +1537,7 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1537
1537
|
exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
1538
1538
|
const { drive_type, app_id, uid, make_public, check_exist } = req;
|
|
1539
1539
|
var file_name, ref;
|
|
1540
|
+
|
|
1540
1541
|
switch (drive_type) {
|
|
1541
1542
|
case "studio": {
|
|
1542
1543
|
ref = await _common.get_project_app_id(req.app_id, true);
|
|
@@ -1550,26 +1551,18 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1550
1551
|
originalname
|
|
1551
1552
|
);
|
|
1552
1553
|
|
|
1553
|
-
if (!(await fs_module.file_exists(target_dir))) {
|
|
1554
|
-
await fs_module.mkdir(target_dir, 0o775, true);
|
|
1555
|
-
}
|
|
1556
1554
|
if (await fs_module.file_exists(target_file)) {
|
|
1557
1555
|
return {
|
|
1558
|
-
code: -
|
|
1559
|
-
data: "file
|
|
1556
|
+
code: -764,
|
|
1557
|
+
data: "file exist",
|
|
1560
1558
|
};
|
|
1561
1559
|
}
|
|
1562
1560
|
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
doc.app_id_reference = ref;
|
|
1568
|
-
|
|
1569
|
-
doc._id = file_name;
|
|
1561
|
+
return {
|
|
1562
|
+
code: 764,
|
|
1563
|
+
data: "ok",
|
|
1564
|
+
};
|
|
1570
1565
|
|
|
1571
|
-
save_ret = await db_module.save_app_couch_doc(ref, doc);
|
|
1572
|
-
misc_module.rsync_drive_resources_to_remote_servers("studio", app_id);
|
|
1573
1566
|
break;
|
|
1574
1567
|
}
|
|
1575
1568
|
case "workspace": {
|