mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 18:36:19 +08:00
Merge branch 'v2.3.0release' into del
This commit is contained in:
commit
06236546a8
@ -39,6 +39,7 @@ type paramsVerificationCode struct {
|
|||||||
OperationID string `json:"operationID" binding:"required"`
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
UsedFor int `json:"usedFor"`
|
UsedFor int `json:"usedFor"`
|
||||||
AreaCode string `json:"areaCode"`
|
AreaCode string `json:"areaCode"`
|
||||||
|
InvitationCode string `json:"invitationCode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendVerificationCode(c *gin.Context) {
|
func SendVerificationCode(c *gin.Context) {
|
||||||
|
@ -30,6 +30,7 @@ type ParamsSetPassword struct {
|
|||||||
FaceURL string `json:"faceURL"`
|
FaceURL string `json:"faceURL"`
|
||||||
OperationID string `json:"operationID" binding:"required"`
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
AreaCode string `json:"areaCode"`
|
AreaCode string `json:"areaCode"`
|
||||||
|
InvitationCode string `json:"invitationCode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetPassword(c *gin.Context) {
|
func SetPassword(c *gin.Context) {
|
||||||
|
@ -144,7 +144,6 @@ func (ws *WServer) MultiTerminalLoginCheckerWithLock(uid string, platformID int,
|
|||||||
rwLock.Lock()
|
rwLock.Lock()
|
||||||
defer rwLock.Unlock()
|
defer rwLock.Unlock()
|
||||||
log.NewInfo(operationID, utils.GetSelfFuncName(), " rpc args: ", uid, platformID, token)
|
log.NewInfo(operationID, utils.GetSelfFuncName(), " rpc args: ", uid, platformID, token)
|
||||||
return
|
|
||||||
switch config.Config.MultiLoginPolicy {
|
switch config.Config.MultiLoginPolicy {
|
||||||
case constant.AllLoginButSameTermKick:
|
case constant.AllLoginButSameTermKick:
|
||||||
if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn]
|
if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn]
|
||||||
|
@ -467,6 +467,10 @@ func (s *userServer) SetGlobalRecvMessageOpt(ctx context.Context, req *pbUser.Se
|
|||||||
log.NewError(req.OperationID, "SetGlobalRecvMessageOpt failed ", err.Error(), user)
|
log.NewError(req.OperationID, "SetGlobalRecvMessageOpt failed ", err.Error(), user)
|
||||||
return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
||||||
}
|
}
|
||||||
|
if err := rocksCache.DelUserInfoFromCache(user.UserID); err != nil {
|
||||||
|
log.NewError(req.OperationID, "DelUserInfoFromCache failed ", err.Error(), req.String())
|
||||||
|
return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}}, nil
|
||||||
|
}
|
||||||
chat.UserInfoUpdatedNotification(req.OperationID, req.UserID, req.UserID)
|
chat.UserInfoUpdatedNotification(req.OperationID, req.UserID, req.UserID)
|
||||||
return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{}}, nil
|
return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{}}, nil
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ type UserTokenReq struct {
|
|||||||
Secret string `json:"secret" binding:"required,max=32"`
|
Secret string `json:"secret" binding:"required,max=32"`
|
||||||
Platform int32 `json:"platform" binding:"required,min=1,max=8"`
|
Platform int32 `json:"platform" binding:"required,min=1,max=8"`
|
||||||
UserID string `json:"userID" binding:"required,min=1,max=64"`
|
UserID string `json:"userID" binding:"required,min=1,max=64"`
|
||||||
LoginIp string `json:"loginIp" binding:"required,max=15"`
|
LoginIp string `json:"loginIp"`
|
||||||
OperationID string `json:"operationID" binding:"required"`
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,8 +253,8 @@ func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID str
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return utils.Wrap(err, "")
|
return utils.Wrap(err, "")
|
||||||
}
|
}
|
||||||
if err = d.RDB.Del(ctx, vals...).Err(); err != nil {
|
for _, v := range vals {
|
||||||
return utils.Wrap(err, "")
|
err = d.RDB.Del(ctx, v).Err()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,12 @@ type Register struct {
|
|||||||
Ex string `gorm:"column:ex;size:1024" json:"ex"`
|
Ex string `gorm:"column:ex;size:1024" json:"ex"`
|
||||||
UserID string `gorm:"column:user_id;type:varchar(255)" json:"userID"`
|
UserID string `gorm:"column:user_id;type:varchar(255)" json:"userID"`
|
||||||
AreaCode string `gorm:"column:area_code;type:varchar(255)"`
|
AreaCode string `gorm:"column:area_code;type:varchar(255)"`
|
||||||
|
InvitationCode string `gorm:"column:invitation_code;type:varchar(255)"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Invitation struct {
|
||||||
|
InvitationCode string `gorm:"column:invitation_code;primary_key;type:varchar(255)"`
|
||||||
|
CreateTime time.Time `gorm:"column:create_time"`
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -78,7 +78,7 @@ func initMysqlDB() {
|
|||||||
&GroupMember{},
|
&GroupMember{},
|
||||||
&GroupRequest{},
|
&GroupRequest{},
|
||||||
&User{},
|
&User{},
|
||||||
&Black{}, &ChatLog{}, &Register{}, &Conversation{}, &AppVersion{}, &Department{}, &BlackList{}, &IpLimit{}, &UserIpLimit{})
|
&Black{}, &ChatLog{}, &Register{}, &Conversation{}, &AppVersion{}, &Department{}, &BlackList{}, &IpLimit{}, &UserIpLimit{}, &Invitation{})
|
||||||
db.Set("gorm:table_options", "CHARSET=utf8")
|
db.Set("gorm:table_options", "CHARSET=utf8")
|
||||||
db.Set("gorm:table_options", "collation=utf8_unicode_ci")
|
db.Set("gorm:table_options", "collation=utf8_unicode_ci")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user