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

pull/267/head
wangchuxiao 2 years ago
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…
Cancel
Save