diff --git a/business/jxutils/datares/datares.go b/business/jxutils/datares/datares.go index 1d6630372..0e6fca441 100644 --- a/business/jxutils/datares/datares.go +++ b/business/jxutils/datares/datares.go @@ -23,8 +23,10 @@ import ( const ( qiniuTokenExpires = 300 // 七牛TOKEN有效时间,5分钟 - MainImgWidth = 800 - MainImgHeight = 800 + MainImgWidth = 800 + MainImgHeight = 800 + MainImgWidth2 = 500 + MainImgHeight2 = 500 ) type UploadResTokenInfo struct { @@ -81,7 +83,7 @@ func RegisterDataResource(ctx *jxcontext.Context, name, resourceURL, mimeType, h return nil, err } if imgType == model.ImgTypeMain { - if img.Bounds().Dx() != MainImgWidth || img.Bounds().Dy() != MainImgHeight { + if (img.Bounds().Dx() != MainImgWidth || img.Bounds().Dy() != MainImgHeight) && (img.Bounds().Dx() != MainImgWidth2 || img.Bounds().Dy() != MainImgHeight2) { return nil, fmt.Errorf("图片大小:%dx%d非法,要求必须:%dx%d", img.Bounds().Dx(), img.Bounds().Dy(), MainImgWidth, MainImgHeight) } }