mirror of https://github.com/halo-dev/halo
fix: fetch work dir backup api. (#1282)
parent
b412d5da2d
commit
a848b734b7
|
@ -56,7 +56,8 @@ public class BackupController {
|
||||||
|
|
||||||
@GetMapping("work-dir/fetch")
|
@GetMapping("work-dir/fetch")
|
||||||
public BackupDTO getWorkDirBackup(@RequestParam("filename") String filename) {
|
public BackupDTO getWorkDirBackup(@RequestParam("filename") String filename) {
|
||||||
return backupService.getBackup(Paths.get(haloProperties.getWorkDir(), filename), WHOLE_SITE)
|
return backupService
|
||||||
|
.getBackup(Paths.get(haloProperties.getBackupDir(), filename), WHOLE_SITE)
|
||||||
.orElseThrow(() ->
|
.orElseThrow(() ->
|
||||||
new NotFoundException("备份文件 " + filename + " 不存在或已删除!").setErrorData(filename));
|
new NotFoundException("备份文件 " + filename + " 不存在或已删除!").setErrorData(filename));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue