diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go index b6ec445f6..3a477e12e 100644 --- a/internal/demo/register/login.go +++ b/internal/demo/register/login.go @@ -37,7 +37,7 @@ func Login(c *gin.Context) { r, err := im_mysql_model.GetRegister(account) if err != nil { - log.NewError(params.OperationID, "user have not register", params.Password, account) + log.NewError(params.OperationID, "user have not register", params.Password, account, err.Error()) c.JSON(http.StatusOK, gin.H{"errCode": constant.NotRegistered, "errMsg": "Mobile phone number is not registered"}) return } diff --git a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go index 2e5d7df86..a10218828 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go @@ -11,7 +11,7 @@ func GetRegister(account string) (*db.Register, error) { return nil, err } var r db.Register - return &r, dbConn.Table("registers").Where("account = ?", + return &r, dbConn.Debug().Table("registers").Where("account = ?", account).Take(&r).Error } @@ -30,7 +30,7 @@ func SetPassword(account, password, ex string) error { func ResetPassword(account, password string) error { r := db.Register{ - Password:password, + Password: password, } dbConn, err := db.DB.MysqlDB.DefaultGormDB() dbConn.LogMode(true)