Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教!! #29

Closed
zhuxibrian opened this issue Mar 10, 2017 · 1 comment
Closed

请教!! #29

zhuxibrian opened this issue Mar 10, 2017 · 1 comment

Comments

@zhuxibrian
Copy link

最近一直在学习这个聊天室,本人初学不久,有个问题想请教。
在Server中,this.socket.user 这里的user是在哪里添加的成员变量呢?没有找到....在Client的socket.js中没有这个成员啊。
求教,感谢!!

@yinxin630
Copy link
Owner

不好意思, 一直没看到该问题, 回复晚了.
在该处添加的, https://github.com/yinxin630/fiora/blob/master/src/server/police/isLogin.js#L22
验证用户是否登录, 并从token中取出用户id, 负载在socket对象上. 不过下一版我已经改了这套机制, 用户信息将会与socket实例绑定, 而不是每次请求都重复计算

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants