@xuda.io/drive_module 1.1.615 → 1.1.617
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 +25 -19
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1418,12 +1418,18 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1418
1418
|
};
|
|
1419
1419
|
doc = { ...doc, ...(await get_file_info(tempPath)) };
|
|
1420
1420
|
|
|
1421
|
-
|
|
1421
|
+
let check_req = {
|
|
1422
|
+
app_id,
|
|
1423
|
+
uid,
|
|
1424
|
+
drive_type,
|
|
1422
1425
|
file_name: doc.originalname,
|
|
1423
1426
|
file_path: doc.file_path,
|
|
1424
|
-
}
|
|
1427
|
+
};
|
|
1428
|
+
const check_res = await module.exports.check_drive_file(check_req);
|
|
1429
|
+
|
|
1425
1430
|
if (check_res.code < 0) {
|
|
1426
|
-
|
|
1431
|
+
const rename_file_name = function (i) {};
|
|
1432
|
+
// return check_res;
|
|
1427
1433
|
}
|
|
1428
1434
|
|
|
1429
1435
|
switch (drive_type) {
|
|
@@ -1477,22 +1483,22 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1477
1483
|
doc.app_id_reference = ref;
|
|
1478
1484
|
|
|
1479
1485
|
/// check existing file
|
|
1480
|
-
if (check_exist) {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
}
|
|
1486
|
+
// if (check_exist) {
|
|
1487
|
+
// const workspace_drive_res = await db_module.find_app_couch_query(
|
|
1488
|
+
// app_id,
|
|
1489
|
+
// {
|
|
1490
|
+
// selector: { docType: "workspace_drive", originalname, stat: 3 },
|
|
1491
|
+
// limit: 99,
|
|
1492
|
+
// }
|
|
1493
|
+
// );
|
|
1494
|
+
// if (workspace_drive_res.docs.length) {
|
|
1495
|
+
// return {
|
|
1496
|
+
// code: -762,
|
|
1497
|
+
// data: "file already exist",
|
|
1498
|
+
// duplicates: workspace_drive_res.docs,
|
|
1499
|
+
// };
|
|
1500
|
+
// }
|
|
1501
|
+
// }
|
|
1496
1502
|
|
|
1497
1503
|
doc.bucket = {
|
|
1498
1504
|
[`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(
|