mirror of https://gitee.com/answerdev/answer.git
Merge branch 'feat/0.4.0/icon-customize' into 'test'
feat: branding support upload icon image See merge request opensource/answer!235
This commit is contained in:
commit
ef2b524f05
|
@ -57,5 +57,9 @@ func (uc *UploadController) UploadFile(ctx *gin.Context) {
|
||||||
handler.HandleResponse(ctx, errors.BadRequest(reason.UploadFileSourceUnsupported), nil)
|
handler.HandleResponse(ctx, errors.BadRequest(reason.UploadFileSourceUnsupported), nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
handler.HandleResponse(ctx, err, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
handler.HandleResponse(ctx, err, url)
|
handler.HandleResponse(ctx, err, url)
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,8 @@ func (us *UploaderService) UploadBrandingFile(ctx *gin.Context) (
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fileExt := strings.ToLower(path.Ext(file.Filename))
|
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)
|
handler.HandleResponse(ctx, errors.BadRequest(reason.RequestFormatError), nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue