Skip to content

本地运行WebSocketSession获取不到用户信息造成空指针 #95

@ZephyrJung

Description

@ZephyrJung

描述问题 Describe the problem

本地启动服务,UserChannel、GobangChannel onConnect方法使用如下代码获取用户信息,但返回为空:

final String userStr = session.getHttpSession().getAttribute(User.USER);

导致双开五子棋无法开始,(UserChannel的onConnect看起来不影响)

期待的结果 Expected result

通过webSocketSession获取用户信息(是否是前端代码缺失?后端根据提交记录无变化,前端gobang.ftl似乎做过恢复)

截屏或录像 Screenshot or video

image

版本环境 Version environment

  • 版本 Version:master最新代码
  • 操作系统 Operating system:不涉及
  • 浏览器(如果使用)Browser (if used):Microsoft Edge

其他信息 Other information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions