feat 废弃jwt 、 学识分

This commit is contained in:
2026-02-06 22:31:29 +08:00
parent b1dfb88f71
commit 456f1970eb
17 changed files with 236 additions and 156 deletions

View File

@@ -29,11 +29,10 @@ type Client struct {
UniqueNo int64 // 副本唯一编号
}
func NewClient(usn int64, conn socket.ISocketConn) *Client {
func NewClient(conn socket.ISocketConn) *Client {
client := &Client{
USN: usn,
conn: conn,
logger: log.GetLogger().Named(fmt.Sprintf("usn:%v", usn)),
logger: log.GetLogger(),
heartBeat: time.Now(),
mailChan: make(chan Event, 1024),
}
@@ -43,6 +42,11 @@ func NewClient(usn int64, conn socket.ISocketConn) *Client {
return client
}
func (c *Client) SetUSN(usn int64) {
c.USN = usn
c.logger = log.GetLogger().Named(fmt.Sprintf("usn:%v", usn))
}
func (c *Client) Loop() {
defer func() {
if err := recover(); err != nil {