@xuda.io/drive_module 1.1.639 → 1.1.641
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 +15 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -617,10 +617,23 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
617
617
|
const { drive_type, app_id, file_path, file_name, uid } = req;
|
|
618
618
|
validate_drive_type(drive_type);
|
|
619
619
|
|
|
620
|
-
|
|
620
|
+
const originalname = file_obj?.["originalname"];
|
|
621
|
+
|
|
622
|
+
if (!originalname) {
|
|
621
623
|
return { code: -4, data: "file data missing" };
|
|
622
624
|
}
|
|
623
625
|
|
|
626
|
+
let check_req = {
|
|
627
|
+
app_id,
|
|
628
|
+
uid,
|
|
629
|
+
drive_type,
|
|
630
|
+
file_name: originalname,
|
|
631
|
+
file_path: doc.file_path,
|
|
632
|
+
};
|
|
633
|
+
const check_existing_file_ret = await module.exports.check_drive_file(
|
|
634
|
+
check_req
|
|
635
|
+
);
|
|
636
|
+
|
|
624
637
|
var target_file = path.join(file_path, file_name);
|
|
625
638
|
const master_id = await _common.get_project_app_id(app_id, true);
|
|
626
639
|
const tempPath = file_obj.path;
|
|
@@ -1444,7 +1457,7 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1444
1457
|
i++;
|
|
1445
1458
|
return await rename_file_name(i);
|
|
1446
1459
|
}
|
|
1447
|
-
return { code: 1, data:
|
|
1460
|
+
return { code: 1, data: tmp_originalname };
|
|
1448
1461
|
};
|
|
1449
1462
|
const rename_ret = await rename_file_name(1);
|
|
1450
1463
|
if (rename_ret.code < 0) {
|