diff --git a/app/customer/hdl/hdl_login.go b/app/customer/hdl/hdl_login.go index 285d145..63b023f 100644 --- a/app/customer/hdl/hdl_login.go +++ b/app/customer/hdl/hdl_login.go @@ -178,14 +178,6 @@ func Register(c *gin.Context) { return } - now := time.Now() - userDb := db.UserDb{} - userDb.Set() - user, err := userDb.GetUserByPhone(req.Phone) - if err != nil { - e.OutErr(c, e.ERR_DB_ORM, err) - return - } //TODO::解密 phone := utils.Base64StdDecode(req.Phone) if phone == "" { @@ -203,6 +195,14 @@ func Register(c *gin.Context) { return } + now := time.Now() + userDb := db.UserDb{} + userDb.Set() + user, err := userDb.GetUserByPhone(req.Phone) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err) + return + } if user == nil { user = &model.User{ UserId: req.UserId,