fix
This commit is contained in:
@@ -2,6 +2,7 @@ package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fusenapi/model/gmodel"
|
||||
"fusenapi/server/data-transfer/internal/svc"
|
||||
"fusenapi/server/data-transfer/internal/types"
|
||||
@@ -9,6 +10,7 @@ import (
|
||||
"fusenapi/utils/basic"
|
||||
"fusenapi/utils/qrcode"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"gorm.io/gorm"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -41,12 +43,12 @@ func (l *UploadQrcodeLogic) UploadQrcode(req *types.UploadQrcodeReq, userinfo *a
|
||||
qrCodeModel := gmodel.NewFsQrcodeSetModel(l.svcCtx.MysqlConn)
|
||||
qrCodeSet, err := qrCodeModel.FindOne(l.ctx, req.QRcodeType)
|
||||
if err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "qrcode setting is not exists")
|
||||
}
|
||||
logx.Error(err)
|
||||
resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get qrcode setting")
|
||||
}
|
||||
if qrCodeSet.Id == 0 {
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "qrcode setting is not exists")
|
||||
}
|
||||
qrType := *qrCodeSet.SvgWebsite
|
||||
if strings.Contains(req.Url, "www.instagram.com") {
|
||||
qrType = *qrCodeSet.SvgInstagram
|
||||
|
||||
Reference in New Issue
Block a user