Skip to content

Commit

Permalink
fix: 解决打开非文本文件报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 committed May 29, 2024
1 parent 3aa62f9 commit 5f521e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/app/service/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down

0 comments on commit 5f521e6

Please sign in to comment.