mirror of https://github.com/1Panel-dev/1Panel
fix: 解决本地备份账号无法切换到根目录的问题 (#3782)
parent
e5d3c1bb86
commit
2f7bb6d784
|
@ -334,7 +334,7 @@ func (u *BackupService) Update(req dto.BackupOperate) error {
|
|||
if backup.Type == "LOCAL" {
|
||||
if dir, ok := varMap["dir"]; ok {
|
||||
if dirStr, isStr := dir.(string); isStr {
|
||||
if strings.HasSuffix(dirStr, "/") {
|
||||
if strings.HasSuffix(dirStr, "/") && dirStr != "/" {
|
||||
dirStr = dirStr[:strings.LastIndex(dirStr, "/")]
|
||||
}
|
||||
if err := copyDir(oldDir, dirStr); err != nil {
|
||||
|
|
Loading…
Reference in New Issue