MCSManager/route/websocket/meum.js
2018-02-24 16:06:00 +08:00

20 lines
724 B
JavaScript

const {
WebSocketObserver
} = require('../../model/WebSocketModel');
const permssion = require('../../helper/Permission');
const response = require('../../helper/Response');
WebSocketObserver().listener('menu', (data) => {
//Object {ws: WebSocket, req: IncomingMessage, user: undefined, header: Object, body: "[body 开始]
//Object {RequestKey: "req", RequestValue: "some"}
if (data.WsSession.login == false) {
response.wsMsgWindow(data.ws, '身份信息丢失,请重新登陆补全身份信息');
return;
}
response.wsSend(data.ws, 'ws/muem', {
username: data.WsSession.username,
});
response.wsMsgWindow(data.ws, '欢迎上线 ' + data.WsSession.username);
});