@xuda.io/drive_module 1.1.757 → 1.1.759

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.
Files changed (2) hide show
  1. package/index.js +5 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -633,11 +633,13 @@ exports.delete_drive_files = async function (req) {
633
633
 
634
634
  exports.update_drive_file = async function (req, job_id, headers, file_obj) {
635
635
  try {
636
- const { drive_type, app_id, file_path, file_name, uid } = req;
636
+ const { drive_type, app_id, file_path, uid } = req;
637
637
  validate_drive_type(drive_type);
638
638
 
639
639
  const originalname = file_obj?.["originalname"];
640
640
 
641
+ const file_name = path.basename(file_path);
642
+
641
643
  if (!originalname) {
642
644
  return { code: -4, data: "file data missing" };
643
645
  }
@@ -646,7 +648,7 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
646
648
  app_id,
647
649
  uid,
648
650
  drive_type,
649
- file_name,
651
+
650
652
  file_path,
651
653
  };
652
654
  const check_existing_file_ret = await module.exports.check_drive_file(
@@ -657,7 +659,7 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
657
659
  return { code: -5, data: "file not exit" };
658
660
  }
659
661
 
660
- var target_file = path.join(file_path, file_name);
662
+ var target_file = file_path;
661
663
  const master_id = await _common.get_project_app_id(app_id, true);
662
664
  const tempPath = file_obj.path;
663
665
  if (drive_type === "studio") {
@@ -781,12 +783,6 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
781
783
  return {
782
784
  code: -760,
783
785
  data: "file not found",
784
- // data: {
785
- // server_file_name: `https://${process.env.XUDA_HOSTNAME}/${
786
- // req.drive_type === "studio" ? "uploads" : "drive"
787
- // }${req.file_name}`,
788
- // filename: file_obj.originalname,
789
- // },
790
786
  };
791
787
  }
792
788
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.757",
3
+ "version": "1.1.759",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {