mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
fix(backend): handle missing share information in DownloadShare and refactor SetRedisShareInfo to use a function for updating view count
This commit is contained in:
@@ -33,6 +33,9 @@ func DownloadShare(c *echo.Context) error {
|
||||
return utils.HTTPErrorHandler(c, ErrInvalidRequest)
|
||||
}
|
||||
shareInfo, _ := models.GetRedisShareInfo(claims.ShareId)
|
||||
if shareInfo == nil {
|
||||
return utils.HTTPErrorHandler(c, ErrShareNotFound)
|
||||
}
|
||||
|
||||
if shareInfo.Type == models.ShareTypeFile {
|
||||
fileInfo, _ := models.GetRedisFileInfo(shareInfo.Data)
|
||||
|
||||
Reference in New Issue
Block a user