From 392e18441a99e4bdf8d57590502e1342b4f177c1 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 5 Dec 2024 14:21:00 +0800 Subject: [PATCH] update --- app/hdl/hdl_login.go | 21 +++++++++++++++++---- go.mod | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index 2ff11bb..967be41 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -1,6 +1,7 @@ package hdl import ( + "applet/app/cfg" "applet/app/db" "applet/app/e" "applet/app/lib/validate" @@ -12,6 +13,8 @@ import ( "code.fnuoos.com/EggPlanet/egg_models.git/src/model" "code.fnuoos.com/EggPlanet/egg_system_rules.git/aliyun" "code.fnuoos.com/EggPlanet/egg_system_rules.git/enum" + md3 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" + "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" "fmt" "github.com/gin-gonic/gin" "time" @@ -234,10 +237,12 @@ func Register(c *gin.Context) { data := svc.AliyunSmsBase(c, "") //校验短信 err = aliyun.AliyunCheckSms(data["aliyun_sms_id"], data["aliyun_sms_secret"], req.Mobile, req.Code) - //if err != nil { - // e.OutErr(c, 400, e.NewErr(400, "验证码错误,请重试")) - // return - //} + if cfg.Prd { + if err != nil { + e.OutErr(c, 400, e.NewErr(400, "验证码错误,请重试")) + return + } + } commReq(c, req) } @@ -402,6 +407,14 @@ func commReq(c *gin.Context, req md.RegisterReq) { if parentUid > 0 { //TODO::推入mq异步处理 } + //TODO::推入mq处理 + ch, err := rabbit.Cfg.Pool.GetChannel() + if err != nil { + e.OutErr(c, e.ERR_INIT_RABBITMQ, err1.Error()) + return + } + defer ch.Release() + ch.Publish(md3.EggAppExchange, utils.SerializeStr(md3.EggNewUserRegisterData{Uid: user.Id}), md3.EggNewUserRegister) } token, err := svc.HandleLoginToken(user) diff --git a/go.mod b/go.mod index 0613ac1..f66a305 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 //replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models -//replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules +replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules require ( github.com/boombuler/barcode v1.0.1 @@ -32,7 +32,7 @@ require ( ) require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241204145112-7b4c29691a6d + code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241205041102-0e106357c399 code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241205020101-e9fa2d461875 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5