mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-27 06:59:54 +08:00
20 lines
724 B
JavaScript
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);
|
|
}); |