فهرست منبع

互联网医院增加PC-patient登陆类型

huangwenjie 6 سال پیش
والد
کامیت
ce5a73b791
2فایلهای تغییر یافته به همراه32 افزوده شده و 0 حذف شده
  1. 13 0
      src/server/handlers/socket.handler.js
  2. 19 0
      src/server/models/socket.io/pcPatient.client.js

+ 13 - 0
src/server/handlers/socket.handler.js

@ -8,6 +8,7 @@ let log = require("../util/log.js");
let clientCache = require('../models/socket.io/client.cache').clientCache();
let PatientClient = require('./../models/socket.io/patient.client');
let PcPatientClient = require('./../models/socket.io/pcPatient.client');
let PcDoctorClient  = require('./../models/socket.io/pcDoctor.client');
let DoctorClient  = require('./../models/socket.io/doctor.client');
let RtcClient  = require('../models/socket.io/rtc.client.js');
@ -45,6 +46,8 @@ class SocketHandler {
                        data.userId = "pc_"+data.userId;
                    }else if("pcim_doctor"===data.clientType){//用于pcim 消息通知
                        data.userId = "pcim_"+data.userId;
                    }else if("pc_patient"===data.clientType){//新增居民PC登陆类型
                        data.userId= "pcpatient_"+data.userId;
                    }
                    if(clientCache.removeByUserId(data.userId)){
@ -62,6 +65,16 @@ class SocketHandler {
                        clientCache.addClient(patientClient);
                        users.login(data.userId, 10, '', '');
                        socket.emit('ack', {});
                    }else if("pc_patient"===data.clientType){
                        //用于pcpatient 消息通知
                        let pcpatientClient = new PcPatientClient(socket, socketServer);
                        pcpatientClient.userId = data.userId;
                        pcpatientClient.password = data.password;
                        pcpatientClient.clientType = data.clientType;
                        pcpatientClient.sessionId = data.sessionId||"";
                        clientCache.addClient(pcpatientClient);
                        users.login(data.userId, 10, '', '');
                        socket.emit('ack', {});
                    }else if("pcim_doctor"===data.clientType){
                        //用于pcim 消息通知
                        let pcdoctorClient = new PcDoctorClient(socket, socketServer);

+ 19 - 0
src/server/models/socket.io/pcPatient.client.js

@ -0,0 +1,19 @@
/**
 * 患者端socket.
 *
 * author: huangwenjie
 * since: 2019/07/01
 */
"use strict";
var util = require('util');
var Client = require('./client');
class pcPatientClient extends Client{
    constructor(socket, socketServer){
        super(socket, socketServer);
    }
}
module.exports = pcPatientClient;