邀请
This commit is contained in:
@@ -432,7 +432,7 @@ func (l *BindEmailWithVerificationLogic) transferDeviceToEmailUser(deviceUserId,
|
||||
l.Errorw("清理原SessionId缓存失败", logger.Field("error", err.Error()), logger.Field("session_id", currentSessionId))
|
||||
// 不返回错误,继续执行
|
||||
} else {
|
||||
l.Infow("已清理原SessionId缓存", logger.Field("session_id", currentSessionId))
|
||||
l.Infow("[SessionMonitor] 绑定邮箱成功后立即清理原 Session", logger.Field("session_id", currentSessionId))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ func (l *BindInviteCodeLogic) BindInviteCode(req *types.BindInviteCodeRequest) e
|
||||
|
||||
// 检查用户是否已经绑定过邀请码
|
||||
if currentUser.RefererId != 0 {
|
||||
return errors.Wrapf(xerr.NewErrCode(xerr.UserExist), "user already bound invite code")
|
||||
return errors.Wrapf(xerr.NewErrCode(xerr.UserBindInviteCodeExist), "用户已绑定邀请人")
|
||||
}
|
||||
|
||||
// 查找邀请人
|
||||
|
||||
@@ -139,6 +139,10 @@ func (l *DeleteAccountLogic) clearCurrentSession(userId int64) {
|
||||
// 从用户会话集合中移除当前session
|
||||
sessionsKey := fmt.Sprintf("%s%v", config.UserSessionsKeyPrefix, userId)
|
||||
_ = l.svcCtx.Redis.ZRem(l.ctx, sessionsKey, sessionId).Err()
|
||||
|
||||
l.Infow("[SessionMonitor] 注销账号清除 Session",
|
||||
logger.Field("user_id", userId),
|
||||
logger.Field("session_id", sessionId))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,8 +126,9 @@ func (l *UnbindDeviceLogic) UnbindDevice(req *types.UnbindDeviceRequest) error {
|
||||
l.svcCtx.DeviceManager.KickDevice(u.Id, identifier)
|
||||
// clean user cache
|
||||
_ = l.svcCtx.UserModel.ClearUserCache(l.ctx, u)
|
||||
l.Infow("设备解绑完成",
|
||||
l.Infow("[SessionMonitor] 设备解绑触发 Session 清理",
|
||||
logger.Field("device_identifier", identifier),
|
||||
logger.Field("user_id", u.Id),
|
||||
logger.Field("elapsed_ms", duration.Milliseconds()))
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user