上传图片测试

This commit is contained in:
苏尹岚
2020-04-01 09:57:28 +08:00
parent 377c64707a
commit b1ceb21f9e

View File

@@ -81,8 +81,11 @@ func RegisterDataResource(ctx *jxcontext.Context, name, resourceURL, mimeType, h
return nil, err return nil, err
} }
if imgType == model.ImgTypeMain { if imgType == model.ImgTypeMain {
fmt.Println("test1111111111111111111111111111111111")
if img.Bounds().Dx() != MainImgWidth || img.Bounds().Dy() != MainImgHeight { if img.Bounds().Dx() != MainImgWidth || img.Bounds().Dy() != MainImgHeight {
fmt.Println("test2222222222222222222222222")
return nil, fmt.Errorf("图片大小:%dx%d非法要求必须:%dx%d", img.Bounds().Dx(), img.Bounds().Dy(), MainImgWidth, MainImgHeight) return nil, fmt.Errorf("图片大小:%dx%d非法要求必须:%dx%d", img.Bounds().Dx(), img.Bounds().Dy(), MainImgWidth, MainImgHeight)
fmt.Println("test3333333333333333333333333333")
} }
} }
dataRes = &model.DataResource{ dataRes = &model.DataResource{