@xuda.io/drive_module 1.1.602 → 1.1.604

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 +16 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1570,11 +1570,11 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
1570
1570
  };
1571
1571
  exports.check_drive_file = async function (req, job_id, headers, file_obj) {
1572
1572
  const { drive_type, app_id, uid, file_name, file_path } = req;
1573
- var ref;
1573
+ var master_app_id;
1574
1574
 
1575
1575
  switch (drive_type) {
1576
1576
  case "studio": {
1577
- ref = await _common.get_project_app_id(req.app_id, true);
1577
+ master_app_id = await _common.get_project_app_id(req.app_id, true);
1578
1578
  const target_dir = path.join(_conf[`studio_drive_path`], ref);
1579
1579
  // file_name = path.join(file_path.replace(target_dir, ""), originalname);
1580
1580
  target_file = path.join(
@@ -1592,12 +1592,20 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
1592
1592
  break;
1593
1593
  }
1594
1594
  case "workspace": {
1595
- ref = await _common.get_project_app_id(req.app_id, true);
1595
+ master_app_id = await _common.get_project_app_id(req.app_id, true);
1596
1596
 
1597
- const workspace_drive_res = await db_module.find_app_couch_query(app_id, {
1598
- selector: { docType: "workspace_drive", file_name, stat: 3 },
1599
- limit: 99,
1600
- });
1597
+ const workspace_drive_res = await db_module.find_app_couch_query(
1598
+ master_app_id,
1599
+ {
1600
+ selector: {
1601
+ docType: "workspace_drive",
1602
+ file_name,
1603
+ file_path,
1604
+ stat: 3,
1605
+ },
1606
+ limit: 99,
1607
+ }
1608
+ );
1601
1609
  if (workspace_drive_res.docs.length) {
1602
1610
  return {
1603
1611
  code: -764,
@@ -1610,7 +1618,7 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
1610
1618
  }
1611
1619
  case "user": {
1612
1620
  const user_drive_res = await db_module.find_couch_query("xuda_drive", {
1613
- selector: { docType: "user_drive", file_name, uid, stat: 3 },
1621
+ selector: { docType: "user_drive", file_name, file_path, uid, stat: 3 },
1614
1622
  limit: 99,
1615
1623
  });
1616
1624
  if (user_drive_res.docs.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.602",
3
+ "version": "1.1.604",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {