This commit is contained in:
wangchuxiao
2022-07-05 11:01:10 +08:00
parent b0669b7eea
commit d0e7147911
4 changed files with 10 additions and 7 deletions
+5 -2
View File
@@ -15,6 +15,7 @@ import (
)
type ParamsLogin struct {
UserID string `json:"userID"`
Email string `json:"email"`
PhoneNumber string `json:"phoneNumber"`
Password string `json:"password"`
@@ -32,11 +33,13 @@ func Login(c *gin.Context) {
var account string
if params.Email != "" {
account = params.Email
} else {
} else if params.PhoneNumber != "" {
account = params.PhoneNumber
} else {
account = params.UserID
}
r, err := im_mysql_model.GetRegister(account, params.AreaCode)
r, err := im_mysql_model.GetRegister(account, params.AreaCode, params.UserID)
if err != nil {
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"})