From dc230a42d55baa46f4d8e8002bb76b6971800c7b Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 21 Dec 2024 13:10:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=82=80=E8=AF=B7=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_login.go | 10 ++++------ app/hdl/hdl_user.go | 2 +- go.mod | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index 6356b11..45e0137 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -429,17 +429,15 @@ func commReq(c *gin.Context, req md.RegisterReq) { // Todo::拥有上下级关系 parentUser, err = userDb.GetUserByInviteCode(req.InviteCode) if err != nil { - e.OutErr(c, e.ERR_DB_ORM, err) + e.OutErr(c, e.ERR_SUP_NOTFOUND, "邀请码失效,请联系上级重新获取分享!") return } - if parentUser.Id == 0 { + if parentUser == nil { parentUser, err = userDb.GetUserByCustomInviteCode(req.InviteCode) - if err != nil { - e.OutErr(c, e.ERR_DB_ORM, err) + if err != nil || parentUser == nil { + e.OutErr(c, e.ERR_SUP_NOTFOUND, "邀请码失效,请联系上级重新获取分享!") return } - e.OutErr(c, e.ERR_SUP_NOTFOUND, "上级用户不存在!") - return } } var parentUid = func() int64 { diff --git a/app/hdl/hdl_user.go b/app/hdl/hdl_user.go index f3c16ab..0bfb9bc 100644 --- a/app/hdl/hdl_user.go +++ b/app/hdl/hdl_user.go @@ -99,7 +99,7 @@ func InviteCodeUserInfo(c *gin.Context) { "value": req.InviteCode, }) if user == nil { - e.OutErr(c, 400, e.NewErr(400, "用户不存在")) + e.OutErr(c, 400, e.NewErr(400, "邀请码失效,请联系上级重新获取分享")) return } } diff --git a/go.mod b/go.mod index 1aab430..bad0009 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( ) require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241219070554-7d4bf7b5cbb2 + code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241221050305-1f1fb9ecdbaa code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241220073933-42987f91e880 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