@xuda.io/drive_module 1.1.672 → 1.1.674
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 +26 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1603,16 +1603,18 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1603
1603
|
break;
|
|
1604
1604
|
}
|
|
1605
1605
|
|
|
1606
|
-
let file_url = `https://${
|
|
1607
|
-
|
|
1608
|
-
}/${drive_type}-drive/${ref}${
|
|
1609
|
-
|
|
1610
|
-
}${file_name}`;
|
|
1611
|
-
if (["workspace"].includes(req.drive_type)) {
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
}
|
|
1606
|
+
// let file_url = `https://${
|
|
1607
|
+
// process.env.XUDA_HOSTNAME
|
|
1608
|
+
// }/${drive_type}-drive/${ref}${
|
|
1609
|
+
// file_name.substr(0, 1) !== "/" ? "/" : ""
|
|
1610
|
+
// }${file_name}`;
|
|
1611
|
+
// if (["workspace"].includes(req.drive_type)) {
|
|
1612
|
+
// file_url = `https://${process.env.XUDA_HOSTNAME}/workspace-drive${
|
|
1613
|
+
// file_name.substr(0, 1) !== "/" ? "/" : ""
|
|
1614
|
+
// }${file_name}`;
|
|
1615
|
+
// }
|
|
1616
|
+
|
|
1617
|
+
let file_url = get_file_url(drive_type, file_name);
|
|
1616
1618
|
|
|
1617
1619
|
await fs_module.unlink(tempPath);
|
|
1618
1620
|
|
|
@@ -2451,4 +2453,18 @@ exports.update_drive_file_tags = async function (req, job_id, headers) {
|
|
|
2451
2453
|
}
|
|
2452
2454
|
};
|
|
2453
2455
|
|
|
2456
|
+
const get_file_url = function (drive_type, file_name) {
|
|
2457
|
+
let file_url = `https://${
|
|
2458
|
+
process.env.XUDA_HOSTNAME
|
|
2459
|
+
}/${drive_type}-drive/${ref}${
|
|
2460
|
+
file_name.substr(0, 1) !== "/" ? "/" : ""
|
|
2461
|
+
}${file_name}`;
|
|
2462
|
+
if (["workspace"].includes(drive_type)) {
|
|
2463
|
+
file_url = `https://${process.env.XUDA_HOSTNAME}/workspace-drive${
|
|
2464
|
+
file_name.substr(0, 1) !== "/" ? "/" : ""
|
|
2465
|
+
}${file_name}`;
|
|
2466
|
+
}
|
|
2467
|
+
return file_url;
|
|
2468
|
+
};
|
|
2469
|
+
|
|
2454
2470
|
setTimeout(function () {}, 2000);
|