feat: branding support upload icon image

This commit is contained in:
LinkinStar 2022-11-15 15:20:41 +08:00
parent d02f64b7a9
commit 70842e18d8
2 changed files with 6 additions and 1 deletions

View File

@ -57,5 +57,9 @@ func (uc *UploadController) UploadFile(ctx *gin.Context) {
handler.HandleResponse(ctx, errors.BadRequest(reason.UploadFileSourceUnsupported), nil)
return
}
if err != nil {
handler.HandleResponse(ctx, err, nil)
return
}
handler.HandleResponse(ctx, err, url)
}

View File

@ -169,7 +169,8 @@ func (us *UploaderService) UploadBrandingFile(ctx *gin.Context) (
return
}
fileExt := strings.ToLower(path.Ext(file.Filename))
if _, ok := FormatExts[fileExt]; !ok {
_, ok := FormatExts[fileExt]
if !ok && fileExt != ".icon" {
handler.HandleResponse(ctx, errors.BadRequest(reason.RequestFormatError), nil)
return
}