From 8748d5b835b7bb1f43660374e19d3f44772dc846 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Mon, 9 Dec 2024 22:15:54 +0800 Subject: [PATCH] update --- app/hdl/hdl_login.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index 2e9ad72..a2a0859 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -319,6 +319,10 @@ func commReq(c *gin.Context, req md.RegisterReq) { }() var parentUser *model.User var inviteCode string + redisConn := cache.GetPool().Get() + sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) + sysCfg := sysCfgDb.SysCfgFindWithDb(enum.AppInviteType, enum.AppInviteLength) + inviteCode = svc.ReturnCode(utils.StrToInt(sysCfg[enum.AppInviteLength]), utils.StrToInt(sysCfg[enum.AppInviteType]), 0) if req.InviteCode != "" { // Todo::拥有上下级关系 parentUser, err = userDb.GetUserByInviteCode(req.InviteCode) @@ -335,10 +339,7 @@ func commReq(c *gin.Context, req md.RegisterReq) { e.OutErr(c, e.ERR_SUP_NOTFOUND, "上级用户不存在!") return } - redisConn := cache.GetPool().Get() - sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) - sysCfg := sysCfgDb.SysCfgFindWithDb(enum.AppInviteType, enum.AppInviteLength) - inviteCode = svc.ReturnCode(utils.StrToInt(sysCfg[enum.AppInviteLength]), utils.StrToInt(sysCfg[enum.AppInviteType]), 0) + initLV := 1 ur := new(model.UserRelate) ur.ParentUid = parentUser.Id