From acc756f9cc1faaeac4587a76cd73f8485c4b7bf6 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Sun, 25 Jun 2023 19:47:31 +0800 Subject: [PATCH] fix --- utils/image/image_size.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/utils/image/image_size.go b/utils/image/image_size.go index 6b568dc5..e9343e9b 100644 --- a/utils/image/image_size.go +++ b/utils/image/image_size.go @@ -52,14 +52,15 @@ func ThousandFaceImageFormat(req *ThousandFaceImageFormatReq) { req.Cover = fmt.Sprintf("%s_%d.%s", coverSlice[0], req.Size, coverSlice[1]) req.CoverImg = fmt.Sprintf("%s_%d.%s", coverImgSlice[0], req.Size, coverImgSlice[1]) } + if req.IsThousandFace == 0 { + return + } //千人千面处理 - if req.IsThousandFace == 1 { - req.Cover = "" - req.CoverDefault = req.CoverImg - if req.Size >= 200 && len(coverSlice) >= 2 && len(coverImgSlice) >= 2 { - req.CoverImg = fmt.Sprintf("%s/test/%d/%d_%d.png?%d", constants.DOMAIN_RENDER_IMG_NAME, req.UserInfo.Id, req.UserInfo.Id, req.ProductId, time.Now().Unix()) - req.CoverDefault = fmt.Sprintf("%s_%d.%s", coverImgSlice[0], req.Size, coverImgSlice[1]) - } + req.Cover = "" + req.CoverDefault = req.CoverImg + if req.Size >= 200 && len(coverSlice) >= 2 && len(coverImgSlice) >= 2 { + req.CoverImg = fmt.Sprintf("%s/test/%d/%d_%d.png?%d", constants.DOMAIN_RENDER_IMG_NAME, req.UserInfo.Id, req.UserInfo.Id, req.ProductId, time.Now().Unix()) + req.CoverDefault = fmt.Sprintf("%s_%d.%s", coverImgSlice[0], req.Size, coverImgSlice[1]) } } }