add: 添加发送ping的 id,name,date字段

This commit is contained in:
zhaoyz 2024-08-06 14:54:35 +08:00
parent 631e67fa6b
commit dbb4bd5da2
4 changed files with 7 additions and 2 deletions

View File

@ -347,6 +347,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
if (patient) { if (patient) {
patient.medicineWS.send(JSON.stringify({msgType: "ping",patientName: name, patient.medicineWS.send(JSON.stringify({msgType: "ping",patientName: name,
idNum: id, idNum: id,
date: date,
msg: + new Date()})) msg: + new Date()}))
} }
}, },
@ -380,6 +381,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
} }
}, },
sendMedicine(args: { sendMedicine(args: {
msgType: string,
name: string, name: string,
id: string, id: string,
date: string, date: string,
@ -392,6 +394,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
const patient: any = this.patient[args.name + args.id + args.date + args.index] const patient: any = this.patient[args.name + args.id + args.date + args.index]
if (patient) { if (patient) {
const params = { const params = {
msgType: args.msgType,
patientName: args.name, patientName: args.name,
idNum: args.id, idNum: args.id,
date: args.date, date: args.date,

View File

@ -12,7 +12,7 @@
<div v-if="!isShowRegister" class="login-block move_2"> <div v-if="!isShowRegister" class="login-block move_2">
<div class="login-way"> <div class="login-way">
<span :class="passwordLogin && 'active'" @click="passwordLogin = true">密码登录</span> <span :class="passwordLogin && 'active'" @click="passwordLogin = true">密码登录</span>
<!-- <span :class="!passwordLogin && 'active'" @click="passwordLogin = false">验证码登录</span>--> <span :class="!passwordLogin && 'active'" @click="passwordLogin = false">验证码登录</span>
</div> </div>
<el-form ref="loginFormRef" :model="loginParams" :rules="loginRules" label-width="0" size="small"> <el-form ref="loginFormRef" :model="loginParams" :rules="loginRules" label-width="0" size="small">
<div class="login-form password-login" v-if="passwordLogin"> <div class="login-form password-login" v-if="passwordLogin">

View File

@ -331,7 +331,6 @@ watch(subscribeMedicineData,(newValue:any,oldValue:any)=>{
case 'pong': case 'pong':
timeDiffPing.value=newValue.msg; timeDiffPing.value=newValue.msg;
break; break;
default: default:
break; break;
} }
@ -717,6 +716,7 @@ const tableItemConfirm = (e: any, tableData: any) => {
// //
if (tableData.length < 1) return; if (tableData.length < 1) return;
const params = { const params = {
msgType: "addMedicine",
name: currentRemote.value.patient, name: currentRemote.value.patient,
id: currentRemote.value.patientId, id: currentRemote.value.patientId,
date: currentRemote.value.date, date: currentRemote.value.date,

View File

@ -24,6 +24,7 @@ export default defineConfig({
proxy: { proxy: {
'/api': { '/api': {
// target: 'http://localhost:9999', // 目标服务器地址 // target: 'http://localhost:9999', // 目标服务器地址
// target: 'http://localhost:6379', // 目标服务器地址
target: 'http://110.41.142.124:6379', // 目标服务器地址 target: 'http://110.41.142.124:6379', // 目标服务器地址
ws: true, // 是否启用 WebSocket ws: true, // 是否启用 WebSocket
changeOrigin: true, // 是否修改请求头中的 Origin 字段 changeOrigin: true, // 是否修改请求头中的 Origin 字段
@ -31,6 +32,7 @@ export default defineConfig({
}, },
'/socket.io': { '/socket.io': {
// target: 'ws://localhost:9999', // target: 'ws://localhost:9999',
// target: 'ws://localhost:6379',
target: 'ws://110.41.142.124:6379', target: 'ws://110.41.142.124:6379',
ws: true, ws: true,
changeOrigin: true, changeOrigin: true,