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:
@@ -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 : "列出文件失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user