This commit is contained in:
henry
2021-11-24 09:59:29 +08:00
parent cf91d55ab2
commit f007168919
21 changed files with 360 additions and 93 deletions

View File

@ -57,7 +57,9 @@ func (c *Account) Login(account, password, captchaKey, captchaValue, equipment,
// Logout 退出请求
func (c *Account) Logout() error {
service.Publish(config.EventForRedisHashDestroy, config.RedisKeyForAccount, utils.UintToString(c.UID))
if c.Session != nil && c.UID > 0 {
service.Publish(config.EventForRedisHashDestroy, config.RedisKeyForAccount, utils.UintToString(c.UID))
}
return nil
}