|
|
@@ -108,12 +108,13 @@ export struct WebDavMainPage {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- const shouldShow = this.isDirectChildOfCurrentPath(folder);
|
|
|
+ let shouldShow = this.isDirectChildOfCurrentPath(folder);
|
|
|
|
|
|
if (shouldShow) {
|
|
|
visible.push(folder);
|
|
|
}
|
|
|
}
|
|
|
+ console.log('更新文件夹列表:', visible);
|
|
|
|
|
|
this.visibleFoldersState = visible;
|
|
|
} catch (error) {
|
|
|
@@ -228,10 +229,10 @@ export struct WebDavMainPage {
|
|
|
|
|
|
// 如果在根目录(currentPath为空或'/'),显示所有第一级文件夹
|
|
|
if (currentPath === '' || currentPath === '/') {
|
|
|
- // 根目录情况下,显示所有第一级文件夹(href格式为/foldername)
|
|
|
+ const folderPath = folder.href.replace(/\/$/, ''); // 去掉尾部斜杠
|
|
|
return folder.href.startsWith('/') &&
|
|
|
folder.href !== '/' &&
|
|
|
- !folder.href.substring(1).includes('/');
|
|
|
+ !folderPath.substring(1).includes('/');
|
|
|
}
|
|
|
|
|
|
// 非根目录情况,计算相对路径
|