mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
🐛 修复密码文件夹不正确的情况下,也显示出了文件夹 readme 的 bug
This commit is contained in:
@@ -21,5 +21,8 @@ public class FileListConfigRequest {
|
||||
|
||||
@ApiModelProperty(value = "请求路径", example = "/")
|
||||
private String path = "/";
|
||||
|
||||
@ApiModelProperty(value = "文件夹密码", example = "123456")
|
||||
private String password;
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user