mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
fix code
This commit is contained in:
@@ -12,13 +12,14 @@ func GetRegister(account, areaCode, userID string) (*db.Register, error) {
|
||||
userID, "", account, account, areaCode).Take(&r).Error
|
||||
}
|
||||
|
||||
func SetPassword(account, password, ex, userID, areaCode string) error {
|
||||
func SetPassword(account, password, ex, userID, areaCode, ip string) error {
|
||||
r := db.Register{
|
||||
Account: account,
|
||||
Password: password,
|
||||
Ex: ex,
|
||||
UserID: userID,
|
||||
AreaCode: areaCode,
|
||||
Account: account,
|
||||
Password: password,
|
||||
Ex: ex,
|
||||
UserID: userID,
|
||||
RegisterIP: ip,
|
||||
AreaCode: areaCode,
|
||||
}
|
||||
return db.DB.MysqlDB.DefaultGormDB().Table("registers").Create(&r).Error
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ func IsLimitUserLoginIp(userID string, LoginIp string) (bool, error) {
|
||||
|
||||
func QueryIPLimits(ip string) (*db.IpLimit, error) {
|
||||
var ipLimit db.IpLimit
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.IpLimit{}).Where("ip=?", ip).First(&ip).Error
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.IpLimit{}).Where("ip=?", ip).Find(&ip).Error
|
||||
return &ipLimit, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user