🐛 修复密码文件夹不正确的情况下,也显示出了文件夹 readme 的 bug

This commit is contained in:
zhaojun
2022-11-26 17:59:52 +08:00
parent d12cbd2383
commit 33c751ab33
2 changed files with 13 additions and 1 deletions

View File

@@ -21,5 +21,8 @@ public class FileListConfigRequest {
@ApiModelProperty(value = "请求路径", example = "/")
private String path = "/";
@ApiModelProperty(value = "文件夹密码", example = "123456")
private String password;
}

View File

@@ -361,8 +361,17 @@ public class StorageSourceService {
// 根据存储源 key 获取存储源 id
Integer storageId = storageSource.getId();
VerifyResultDTO verifyPassword = passwordConfigService.verifyPassword(storageId, path, fileListConfigRequest.getPassword());
ReadmeConfig readmeByPath = null;
if (verifyPassword.isPassed()) {
// 获取指定存储源路径下的 readme 信息
readmeByPath = readmeConfigService.getByStorageAndPath(storageId, path, storageSource.getCompatibilityReadme());
} else {
log.info("文件夹密码验证失败,不获取 readme 信息, storageId: {}, path: {}, password: {}", storageId, path, fileListConfigRequest.getPassword());
}
// 获取指定存储源路径下的 readme 信息
ReadmeConfig readmeByPath = readmeConfigService.getByStorageAndPath(storageId, path, storageSource.getCompatibilityReadme());
return storageSourceConvert.entityToConfigResult(storageSource, readmeByPath);
}