mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-09-01 04:00:06 +08:00
Merge branch 'del' of github.com:OpenIMSDK/Open-IM-Server into del
This commit is contained in:
commit
4ec255917d
@ -133,8 +133,12 @@ func QueryUserIPLimitLogin(c *gin.Context) {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": "GetIpLimitsByUserID error!"})
|
||||
return
|
||||
}
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp)
|
||||
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp})
|
||||
if len(resp) > 0 {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp)
|
||||
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": "[]"})
|
||||
}
|
||||
|
||||
type AddUserIPLimitLoginReq struct {
|
||||
|
@ -59,7 +59,7 @@ func DeleteOneFromIpLimits(ip string) error {
|
||||
|
||||
func GetIpLimitsLoginByUserID(userID string) ([]db.UserIpLimit, error) {
|
||||
var ips []db.UserIpLimit
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.UserIpLimit{}).Where("user_id=?", userID).Take(&ips).Error
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.UserIpLimit{}).Where("user_id=?", userID).Find(&ips).Error
|
||||
return ips, err
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user