fix(backend): handle missing share information in DownloadShare and refactor SetRedisShareInfo to use a function for updating view count

This commit is contained in:
keven1024
2026-04-06 11:13:27 +08:00
parent 7566ddb5f2
commit d3e7760aea

View File

@@ -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)