Browse Source

修改light_state格式不对的问题

zengminguo 2 years ago
parent
commit
841ee0683f
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/User.js

+ 6 - 2
src/User.js

@@ -280,6 +280,10 @@ export default class User {
         // }
         
 
+        if (cmd === 'light_state')
+        {
+          req.dataForLightState = req.data
+        }
         // TODO 后续打开 加上device_state全局广播逻辑
         // req.data = JSON.stringify(datas)
         if (cmd === 'device_state' || cmd === 'light_state' || cmd === 'tof_data') {
@@ -288,8 +292,8 @@ export default class User {
           console.log(req)
           this.socket.emit('PUSH', req)
         }
-	if (cmd === 'load_history_completed') {
-	  console.log(req)
+	      if (cmd === 'load_history_completed') {
+	        console.log(req)
           this.socket.emit('PUSH', req)
         }
         Pusher.push(socket, req)