Commit 349d09b7 authored by wanli's avatar wanli

🐞 fix(文件管理后端接口):

修复文件管理后端接口获取目录详情bug
parent 501aa1fb
...@@ -96,21 +96,23 @@ class FileManager(object): ...@@ -96,21 +96,23 @@ class FileManager(object):
"files": [] "files": []
} }
if target_path == None: if target_path != None and target_path.find(disk) > 0:
target_path = ''
disk_path = Path(disk_root).joinpath(disk)
else:
disk_path = Path(disk_root) disk_path = Path(disk_root)
else:
disk_path = Path(disk_root).joinpath(disk)
if not disk_path.exists(): if not disk_path.exists():
logger.info(disk_path) logger.info(disk_path)
return result, ResponseCode.DIRECTORY_NOT_EXISTS return None, ResponseCode.DIRECTORY_NOT_EXISTS
if target_path == None:
target_path = ''
target_path = Path(target_path) target_path = Path(target_path)
target_path = disk_path.joinpath(target_path) target_path = disk_path.joinpath(target_path)
if not target_path.exists(): if not target_path.exists():
logger.info(target_path) logger.info(target_path)
return result, ResponseCode.DIRECTORY_NOT_EXISTS return None, ResponseCode.DIRECTORY_NOT_EXISTS
for child in target_path.iterdir(): for child in target_path.iterdir():
if child.is_dir(): if child.is_dir():
......
{"directories": [{"basename": "evm", "dirname": "uploads/evueapps", "path": "uploads/evueapps/evm", "timestamp": 1625930440, "type": "dir"}], "files": []} {"directories": [{"basename": "evm", "dirname": "evueapps", "path": "evueapps/evm", "timestamp": 1625930440, "type": "dir"}], "files": []}
\ No newline at end of file \ No newline at end of file
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
}); });
}, },
edit(record) { edit(record) {
this.$router.push({ name: "FileManager", params: { directory: record.file_dir } }) this.$router.push({ name: "FileManager", params: { directory: record.file_dir, disk: "uploads" } })
}, },
resetForm() { resetForm() {
this.query = { this.query = {
......
...@@ -119,6 +119,9 @@ export default { ...@@ -119,6 +119,9 @@ export default {
EventBus.$emit('keyMonitor', event); EventBus.$emit('keyMonitor', event);
}); });
*/ */
// 切换目录
}, },
destroyed() { destroyed() {
// reset state // reset state
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment