mirror of https://github.com/1Panel-dev/1Panel
fix: 解决打开非文本文件报错的问题 (#5203)
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…
Reference in New Issue