@xuda.io/drive_module 1.1.557 → 1.1.559
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 +12 -13
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1399,18 +1399,17 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1399
1399
|
|
|
1400
1400
|
if (!(await fs_module.file_exists(target_dir))) {
|
|
1401
1401
|
await fs_module.mkdir(target_dir, 0o775, true);
|
|
1402
|
-
} else {
|
|
1403
|
-
if (await fs_module.file_exists(target_file)) {
|
|
1404
|
-
return {
|
|
1405
|
-
code: -762,
|
|
1406
|
-
data: "file already exist",
|
|
1407
|
-
};
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
// if (await fs_module.file_exists(target_file)) {
|
|
1411
|
-
// await fs_module.unlink(target_file);
|
|
1412
|
-
// }
|
|
1413
1402
|
}
|
|
1403
|
+
if (await fs_module.file_exists(target_file)) {
|
|
1404
|
+
return {
|
|
1405
|
+
code: -762,
|
|
1406
|
+
data: "file already exist",
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
// if (await fs_module.file_exists(target_file)) {
|
|
1411
|
+
// await fs_module.unlink(target_file);
|
|
1412
|
+
// }
|
|
1414
1413
|
|
|
1415
1414
|
await fs_module.copy(tempPath, target_file);
|
|
1416
1415
|
doc.server_file_name = file_name;
|
|
@@ -1482,11 +1481,11 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1482
1481
|
selector: { docType: "user_drive", originalname, stat: 3 },
|
|
1483
1482
|
limit: 99,
|
|
1484
1483
|
});
|
|
1485
|
-
if (
|
|
1484
|
+
if (user_drive_res.docs.length) {
|
|
1486
1485
|
return {
|
|
1487
1486
|
code: -762,
|
|
1488
1487
|
data: "file already exist",
|
|
1489
|
-
duplicates:
|
|
1488
|
+
duplicates: user_drive_res.docs,
|
|
1490
1489
|
};
|
|
1491
1490
|
}
|
|
1492
1491
|
|