登陆成功或者密码错误时发送日志
This commit is contained in:
parent
76e86c9f06
commit
91afff4451
@ -110,17 +110,21 @@ func (s *LoginService) onLoginOrRegister(iMsg *ipb.InternalMsg, req *pb.C2SUserL
|
||||
s.SendServiceMsg(service.TopicEx(iMsg.ServiceName), iMsg.ConnId, userId, int32(pb.MsgId_S2CUserLoginId), rsp)
|
||||
|
||||
if us != nil && us.ID > 0 {
|
||||
switch code {
|
||||
case pb.ErrCode_LoginUserOrPwdErr:
|
||||
rpcMsg := ipb.MakeRpcMsg[user.UserLoginLog](rpcName.GetUserAccount, 0, &user.UserLoginLog{
|
||||
loginLog := &user.UserLoginLog{
|
||||
UID: us.ID,
|
||||
LoginIP: us.LastLoginIP,
|
||||
LoginIP: req.Ip,
|
||||
LoginTime: time.Now(),
|
||||
DeviceInfo: us.DeviceID,
|
||||
DeviceInfo: req.DeviceId,
|
||||
LoginResult: code == pb.ErrCode_OK,
|
||||
FailReason: code.String(),
|
||||
})
|
||||
}
|
||||
switch code {
|
||||
case pb.ErrCode_LoginUserOrPwdErr, pb.ErrCode_OK:
|
||||
rpcMsg := ipb.MakeRpcMsg[user.UserLoginLog](rpcName.LogUserAccountLogin, 0, loginLog)
|
||||
ksync.GoSafe(func() {
|
||||
_, _ = s.Call(service.RpcTopicEx(node.Name), timeout, rpcMsg)
|
||||
}, nil)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user