@xuda.io/drive_module 1.1.503 → 1.1.505
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 +10 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1865,24 +1865,30 @@ exports.get_drive_size = async function (req) {
|
|
|
1865
1865
|
// } else {
|
|
1866
1866
|
// ref = await _common.get_project_app_id(app_id, true);
|
|
1867
1867
|
// }
|
|
1868
|
-
let app_id_master;
|
|
1868
|
+
let app_id_master, directoryPath;
|
|
1869
1869
|
switch (drive_type) {
|
|
1870
1870
|
case "user":
|
|
1871
|
+
directoryPath = "";
|
|
1872
|
+
size = await get_folder_size(directoryPath, drive_type, app_id_master);
|
|
1871
1873
|
break;
|
|
1872
1874
|
case "workspace":
|
|
1875
|
+
directoryPath = "";
|
|
1876
|
+
app_id_master = await _common.get_project_app_id(app_id, true);
|
|
1873
1877
|
break;
|
|
1874
1878
|
|
|
1875
1879
|
default:
|
|
1876
|
-
|
|
1877
|
-
|
|
1880
|
+
app_id_master = await _common.get_project_app_id(app_id, true);
|
|
1881
|
+
directoryPath = path.join(
|
|
1878
1882
|
_conf[`${drive_type}_drive_path`],
|
|
1879
1883
|
app_id_master,
|
|
1880
1884
|
"/"
|
|
1881
1885
|
);
|
|
1882
|
-
|
|
1886
|
+
|
|
1883
1887
|
break;
|
|
1884
1888
|
}
|
|
1885
1889
|
|
|
1890
|
+
size = await get_folder_size(directoryPath, drive_type, app_id_master);
|
|
1891
|
+
|
|
1886
1892
|
return { code: 200, data: size };
|
|
1887
1893
|
} catch (err) {
|
|
1888
1894
|
return { code: -200, data: err.message };
|