This commit is contained in:
laodaming
2023-06-16 11:15:38 +08:00
parent 169c167d4a
commit 748e707dfa
4 changed files with 78 additions and 47 deletions

View File

@@ -54,7 +54,18 @@ func (l *UploadQrcodeLogic) UploadQrcode(req *types.UploadQrcodeReq, userinfo *a
qrType = *qrCodeSet.SvgFacebook
}
//生成二维码
imgBase64, err := qrcode.CreateQrCodeBs64WithLogo(req.Url, "", "", 512, int(*qrCodeSet.IndexX), int(*qrCodeSet.IndexY), true)
qrReq := qrcode.CreateQrCodeBs64WithLogoReq{
Content: req.Url,
OutPath: nil,
LogoPath: nil,
Size: *qrCodeSet.Size,
X: qrCodeSet.IndexX,
Y: qrCodeSet.IndexY,
ForegroundColor: nil,
BackgroundColor: nil,
DisableBorder: false,
}
imgBase64, err := qrcode.CreateQrCodeBs64WithLogo(qrReq)
if err != nil {
logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to generate qrcode")