mirror of https://gitee.com/answerdev/answer.git
feat: branding support upload icon image
This commit is contained in:
parent
d02f64b7a9
commit
70842e18d8
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue