@xuda.io/drive_module 1.1.586 → 1.1.588
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 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -625,7 +625,10 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
625
625
|
|
|
626
626
|
const tempPath = file_obj.path;
|
|
627
627
|
if (drive_type === "studio") {
|
|
628
|
-
|
|
628
|
+
try {
|
|
629
|
+
fse.unlinkSync(target_file);
|
|
630
|
+
} catch (error) {}
|
|
631
|
+
|
|
629
632
|
fse.copyFileSync(tempPath, target_file);
|
|
630
633
|
}
|
|
631
634
|
|
|
@@ -729,13 +732,14 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
729
732
|
};
|
|
730
733
|
} else {
|
|
731
734
|
return {
|
|
732
|
-
code: 760,
|
|
733
|
-
data:
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
735
|
+
code: -760,
|
|
736
|
+
data: "file not found",
|
|
737
|
+
// data: {
|
|
738
|
+
// server_file_name: `https://${process.env.XUDA_HOSTNAME}/${
|
|
739
|
+
// req.drive_type === "studio" ? "uploads" : "drive"
|
|
740
|
+
// }${req.file_name}`,
|
|
741
|
+
// filename: file_obj.originalname,
|
|
742
|
+
// },
|
|
739
743
|
};
|
|
740
744
|
}
|
|
741
745
|
} catch (err) {
|