mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
fix: 解决打开非文本文件报错的问题 (#5203)
This commit is contained in:
parent
9f3573bcb8
commit
86d021cbfc
@ -231,6 +231,9 @@ func (f *FileService) GetContent(op request.FileContentReq) (response.FileInfo,
|
||||
Path: op.Path,
|
||||
Expand: true,
|
||||
})
|
||||
if err != nil {
|
||||
return response.FileInfo{}, err
|
||||
}
|
||||
|
||||
content := []byte(info.Content)
|
||||
var decodeName string
|
||||
@ -248,9 +251,6 @@ func (f *FileService) GetContent(op request.FileContentReq) (response.FileInfo,
|
||||
}
|
||||
info.Content = string(contents)
|
||||
}
|
||||
if err != nil {
|
||||
return response.FileInfo{}, err
|
||||
}
|
||||
return response.FileInfo{FileInfo: *info}, nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user