Private
Public Access
1
0

修复: OSS收藏打开+连接指示器根目录+字段映射+侧边栏重构+文件监听+首屏优化

This commit is contained in:
2026-05-16 17:55:59 +08:00
parent 316e517989
commit d17c20c579
37 changed files with 1667 additions and 1566 deletions

View File

@@ -268,6 +268,11 @@ func (s *FileSystemService) DeletePathWithContext(ctx context.Context, path stri
// ListDir 列出目录内容
func (s *FileSystemService) ListDir(path string) ([]map[string]interface{}, error) {
// 根路径:返回 Windows 盘符列表
if path == "/" || path == "\\" {
return s.listDrives()
}
// 路径验证
if err := s.validatePath(path); err != nil {
return nil, err
@@ -308,6 +313,25 @@ func (s *FileSystemService) ListDir(path string) ([]map[string]interface{}, erro
return result, nil
}
// listDrives 列出 Windows 可用盘符
func (s *FileSystemService) listDrives() ([]map[string]interface{}, error) {
result := make([]map[string]interface{}, 0)
for _, drive := range "ABCDEFGHIJKLMNOPQRSTUVWXYZ" {
path := string(drive) + ":/"
_, err := os.Stat(path)
if err != nil {
continue
}
result = append(result, map[string]interface{}{
"name": string(drive) + ":",
"path": path,
"is_dir": true,
"size": int64(0),
})
}
return result, nil
}
// CreateDir 创建目录,返回创建的目录信息
func (s *FileSystemService) CreateDir(path string) (*FileOperationResult, error) {
if err := s.validatePath(path); err != nil {