@xuda.io/drive_module 1.1.600 → 1.1.602
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 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1569,17 +1569,17 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1569
1569
|
}
|
|
1570
1570
|
};
|
|
1571
1571
|
exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
1572
|
-
const { drive_type, app_id, uid,
|
|
1573
|
-
var
|
|
1572
|
+
const { drive_type, app_id, uid, file_name, file_path } = req;
|
|
1573
|
+
var ref;
|
|
1574
1574
|
|
|
1575
1575
|
switch (drive_type) {
|
|
1576
1576
|
case "studio": {
|
|
1577
1577
|
ref = await _common.get_project_app_id(req.app_id, true);
|
|
1578
1578
|
const target_dir = path.join(_conf[`studio_drive_path`], ref);
|
|
1579
|
-
file_name = path.join(
|
|
1579
|
+
// file_name = path.join(file_path.replace(target_dir, ""), originalname);
|
|
1580
1580
|
target_file = path.join(
|
|
1581
|
-
|
|
1582
|
-
|
|
1581
|
+
file_path !== "/" ? file_path : target_dir,
|
|
1582
|
+
file_name
|
|
1583
1583
|
);
|
|
1584
1584
|
|
|
1585
1585
|
if (await fs_module.file_exists(target_file)) {
|
|
@@ -1595,7 +1595,7 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1595
1595
|
ref = await _common.get_project_app_id(req.app_id, true);
|
|
1596
1596
|
|
|
1597
1597
|
const workspace_drive_res = await db_module.find_app_couch_query(app_id, {
|
|
1598
|
-
selector: { docType: "workspace_drive",
|
|
1598
|
+
selector: { docType: "workspace_drive", file_name, stat: 3 },
|
|
1599
1599
|
limit: 99,
|
|
1600
1600
|
});
|
|
1601
1601
|
if (workspace_drive_res.docs.length) {
|
|
@@ -1610,7 +1610,7 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1610
1610
|
}
|
|
1611
1611
|
case "user": {
|
|
1612
1612
|
const user_drive_res = await db_module.find_couch_query("xuda_drive", {
|
|
1613
|
-
selector: { docType: "user_drive",
|
|
1613
|
+
selector: { docType: "user_drive", file_name, uid, stat: 3 },
|
|
1614
1614
|
limit: 99,
|
|
1615
1615
|
});
|
|
1616
1616
|
if (user_drive_res.docs.length) {
|