@xuda.io/drive_module 1.1.503 → 1.1.504
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 +8 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1865,24 +1865,28 @@ 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
|
+
size = await get_folder_size(directoryPath, drive_type, app_id_master);
|
|
1871
1872
|
break;
|
|
1872
1873
|
case "workspace":
|
|
1874
|
+
app_id_master = await _common.get_project_app_id(app_id, true);
|
|
1873
1875
|
break;
|
|
1874
1876
|
|
|
1875
1877
|
default:
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
+
app_id_master = await _common.get_project_app_id(app_id, true);
|
|
1879
|
+
directoryPath = path.join(
|
|
1878
1880
|
_conf[`${drive_type}_drive_path`],
|
|
1879
1881
|
app_id_master,
|
|
1880
1882
|
"/"
|
|
1881
1883
|
);
|
|
1882
|
-
|
|
1884
|
+
|
|
1883
1885
|
break;
|
|
1884
1886
|
}
|
|
1885
1887
|
|
|
1888
|
+
size = await get_folder_size(directoryPath, drive_type, app_id_master);
|
|
1889
|
+
|
|
1886
1890
|
return { code: 200, data: size };
|
|
1887
1891
|
} catch (err) {
|
|
1888
1892
|
return { code: -200, data: err.message };
|