Merge branch 'del' of github.com:OpenIMSDK/Open-IM-Server into del

# Conflicts:
#	pkg/common/db/mysql_model/im_mysql_model/ip_model.go
This commit is contained in:
wangchuxiao
2022-08-15 18:58:48 +08:00
5 changed files with 138 additions and 28 deletions
+4 -3
View File
@@ -8,7 +8,6 @@ import (
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
http2 "Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
pbAuth "Open_IM/pkg/proto/auth"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"encoding/json"
@@ -47,10 +46,12 @@ func SetPassword(c *gin.Context) {
Limited, LimitError := imdb.IsLimitRegisterIp(ip)
if LimitError != nil {
log.Error(params.OperationID, utils.GetSelfFuncName(), LimitError, ip)
c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()})
c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": LimitError.Error()})
return
}
if Limited {
c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()})
c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.RegisterLimit, "errMsg": "limited"})
return
}
var account string