@xuda.io/drive_module 1.1.554 → 1.1.556
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 +19 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1477,15 +1477,29 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1477
1477
|
break;
|
|
1478
1478
|
}
|
|
1479
1479
|
case "user": {
|
|
1480
|
+
if (check_exist) {
|
|
1481
|
+
const workspace_drive_res = await db_module.find_couch_query(
|
|
1482
|
+
"drive",
|
|
1483
|
+
{
|
|
1484
|
+
selector: { docType: "user_drive", originalname, stat: 3 },
|
|
1485
|
+
limit: 99,
|
|
1486
|
+
}
|
|
1487
|
+
);
|
|
1488
|
+
if (workspace_drive_res.docs.length) {
|
|
1489
|
+
return {
|
|
1490
|
+
code: -762,
|
|
1491
|
+
data: "file already exist",
|
|
1492
|
+
duplicates: workspace_drive_res.docs,
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1480
1497
|
ref = uid;
|
|
1481
1498
|
file_name =
|
|
1482
1499
|
"drv_" + ref + "_" + (await _common.xuda_get_uuid(drive_type)) + ext;
|
|
1483
|
-
|
|
1484
|
-
// req.path !== "/" ? req.path : target_dir,
|
|
1485
|
-
// file_name
|
|
1486
|
-
// );
|
|
1500
|
+
|
|
1487
1501
|
doc.server_file_name = file_name;
|
|
1488
|
-
|
|
1502
|
+
|
|
1489
1503
|
doc.bucket = {
|
|
1490
1504
|
[`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(
|
|
1491
1505
|
tempPath,
|