diff --git a/backend/server.js b/backend/server.js index 4c5c701..73b2a8d 100644 --- a/backend/server.js +++ b/backend/server.js @@ -1135,7 +1135,7 @@ app.post('/api/files/mkdir', authMiddleware, async (req, res) => { // 获取文件夹详情(大小统计) app.post('/api/files/folder-info', authMiddleware, async (req, res) => { - const { path, folderName } = req.body; + const { path: dirPath, folderName } = req.body; let storage; if (!folderName) { @@ -1159,7 +1159,7 @@ app.post('/api/files/folder-info', authMiddleware, async (req, res) => { storage = await storageInterface.connect(); // 构造文件夹路径 - const basePath = path || '/'; + const basePath = dirPath || '/'; const folderPath = basePath === '/' ? `/${folderName}` : `${basePath}/${folderName}`; const fullPath = storage.getFullPath(folderPath); @@ -1183,14 +1183,14 @@ app.post('/api/files/folder-info', authMiddleware, async (req, res) => { const folderSize = storage.calculateFolderSize(fullPath); // 计算文件数量 - function countFiles(dirPath) { + function countFiles(countDirPath) { let fileCount = 0; let folderCount = 0; - const items = fs.readdirSync(dirPath, { withFileTypes: true }); + const items = fs.readdirSync(countDirPath, { withFileTypes: true }); for (const item of items) { - const itemPath = path.join(dirPath, item.name); + const itemPath = path.join(countDirPath, item.name); if (item.isDirectory()) { folderCount++; diff --git a/frontend/app.html b/frontend/app.html index adf7992..0478136 100644 --- a/frontend/app.html +++ b/frontend/app.html @@ -1773,7 +1773,7 @@
查看详情
-
+
分享