From 0f96fb73d06a471b178c5175d35fa3ef5d7922ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 28 Dec 2020 14:55:21 +0800 Subject: [PATCH] aa --- business/jxutils/datares/datares.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) } }