feat:完善项目

This commit is contained in:
henry
2021-11-15 17:32:23 +08:00
parent f5e2063685
commit 78128277ff
27 changed files with 717 additions and 105 deletions

View File

@ -73,7 +73,7 @@ func (c *Instance) Login(account, password, captchaKey, captchaValue, ip string)
// Logout 退出请求
func (c *Instance) Logout() error {
if c.UID > 0 {
if c.Session != nil && c.UID > 0 {
service.Publish(config.EventForRedisHashDestroy, config.RedisKeyForAccount, utils.UintToString(c.UID))
service.HubMessage.UnregisterHandle(service.NewWebsocket(c.UIDToString(), nil))
}