|
|
@@ -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) |
|
|
|