fix local

This commit is contained in:
jxxghp
2024-07-26 22:04:50 +08:00
parent 4f4c7a5748
commit 40663b6ce7
5 changed files with 13 additions and 16 deletions

View File

@@ -38,7 +38,7 @@ class FileManagerModule(_ModuleBase):
def init_module(self) -> None:
# 加载模块
self._storage_schemas = ModuleHelper.load('app.modules.filemanager.storage',
filter_func=lambda _, obj: hasattr(obj, 'schema'))
filter_func=lambda _, obj: hasattr(obj, 'schema') and obj.schema)
@staticmethod
def get_name() -> str:
@@ -264,7 +264,7 @@ class FileManagerModule(_ModuleBase):
获取存储操作对象
"""
for storage_schema in self._storage_schemas:
if storage_schema.schema == _storage:
if storage_schema.schema and storage_schema.schema.value == _storage:
return storage_schema()
return None

View File

@@ -101,7 +101,7 @@ class LocalStorage(StorageBase):
ret_items.append(self.__get_diritem(item))
# 遍历所有文件,不含子目录
for item in SystemUtils.list_sub_all(path_obj):
for item in SystemUtils.list_sub_file(path_obj):
ret_items.append(self.__get_fileitem(item))
return ret_items