Skip to content

Commit f6e065e

Browse files
committed
文件列表字典排序
1 parent 2c79882 commit f6e065e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/terminal/src/main/java/com/kkbpro/terminal/controller/FileController.java

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ public Result ls(String sshKey, String path) throws IOException {
140140
try {
141141
SFTPClient sftp = getSftpClient(sshKey);
142142
List<RemoteResourceInfo> files = sftp.ls(path);
143+
// 按照文件名排序
144+
files.sort(Comparator.comparing(RemoteResourceInfo::getName));
143145
int index = 0;
144146
for(RemoteResourceInfo file : files) {
145147
FileInfo fileInfo = new FileInfo();

0 commit comments

Comments
 (0)