Refactor error handling in FileController and enhance file rendering logic in app.js. Improved error messages and added checks for data structure integrity. Updated connection handling to maintain independent selections for SFTP connections across panels.

This commit is contained in:
liu
2026-02-03 10:23:00 +08:00
parent 4f5e135091
commit 9f72ff5a48
2 changed files with 56 additions and 23 deletions

View File

@@ -55,7 +55,9 @@ public class FileController {
return ApiResponse.success("查询成功", files);
} catch (Exception e) {
return ApiResponse.error("列出文件失败: " + e.getMessage());
// SftpService 已抛出带「列出文件失败:」前缀的消息,此处不再重复拼接
String msg = e.getMessage();
return ApiResponse.error(msg != null ? msg : "列出文件失败");
}
}