Explorar o código

增加调试打印

zhangafei hai 1 mes
pai
achega
25f527b2f0
Modificáronse 3 ficheiros con 4 adicións e 2 borrados
  1. 1 0
      src/utils/mqtt/mqtt.ts
  2. 2 1
      src/views/home/CarArrive.vue
  3. 1 1
      vite.config.ts

+ 1 - 0
src/utils/mqtt/mqtt.ts

@@ -41,6 +41,7 @@ export class Mqtt {
   }
 
   onConnect() {
+    console.log(' mq connected.')
     this.client!.removeAllListeners('message')
     this.client!.on('message', (topic, payload, packet) =>
       this.onMessage(topic, payload.toString(), packet),

+ 2 - 1
src/views/home/CarArrive.vue

@@ -57,7 +57,7 @@
             v-if="!vehicleInfo.steelReachTime"
             size="large"
             type="primary"
-            :disabled="!!vehicleInfo.outTime"
+            :disabled="!!vehicleInfo.steelReachTime"
             @click="handleClick('confirmDestination')"
           >
             确认到达
@@ -405,6 +405,7 @@ const editInfo = (params: { licensePlate?: string; arriveNum?: string | number }
 
 const onMessage = (msg: Record<string, string>) => {
   const { car, position } = msg
+  console.log('接收到了onMessage消息 = ', msg)
   if (!car || Number(positionNo) !== Number(position)) return
   arriveNo.value = position
   getVehicleInfo(car)

+ 1 - 1
vite.config.ts

@@ -33,7 +33,7 @@ export default defineConfig({
     open: true,
     proxy: {
       '/jeecgbootbus': {
-        target: 'http://192.168.1.8:9999',
+        target: 'http://192.168.0.119:9999',
         changeOrigin: true,
         ws: true,
         rewrite: (path) => path.replace(/^\/jeecgbootbus/, ''),