@xuda.io/drive_module 1.1.1042 → 1.1.1044

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 +14 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -194,7 +194,8 @@ exports.get_drive_files = async function (req) {
194
194
  ret,
195
195
  file_doc,
196
196
  app_id_reference,
197
- uid
197
+ uid,
198
+ datasource_id
198
199
  ) {
199
200
  let files = {
200
201
  path: req.path || "/",
@@ -214,7 +215,9 @@ exports.get_drive_files = async function (req) {
214
215
  size: formatBytes(doc.size),
215
216
  extension: doc?.file_ext?.substr(1),
216
217
  type: doc.type,
217
- access_link: `https://${process.env.XUDA_HOSTNAME}/${drive_type}-drive/${app_id}/${doc._id}`,
218
+ access_link: `https://${
219
+ process.env.XUDA_HOSTNAME
220
+ }/${drive_type}-drive/${datasource_id || app_id}/${doc._id}`,
218
221
  is_archive: doc.is_archive,
219
222
  public: doc.public,
220
223
  path: doc.file_path,
@@ -267,9 +270,17 @@ exports.get_drive_files = async function (req) {
267
270
  path.basename(req.path) || "/"
268
271
  );
269
272
 
273
+ const { data: app_obj } = await db_module.get_app_obj(app_id);
274
+
270
275
  return {
271
276
  code: 1,
272
- data: await get_drive_files(ret, file_doc, app_id_reference, null),
277
+ data: await get_drive_files(
278
+ ret,
279
+ file_doc,
280
+ app_id_reference,
281
+ null,
282
+ app_obj.datasource_id
283
+ ),
273
284
  };
274
285
  };
275
286
  const get_user_files = async function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.1042",
3
+ "version": "1.1.1044",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {