liuyu 4 anos atrás
pai
commit
550c5a9880
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      app/service/room.js

+ 3 - 1
app/service/room.js

@@ -180,9 +180,11 @@ class RoomService extends CrudService {
   async switchzb({ id }) {
     const resmodel = await this.model.findById(id);
     if (resmodel) {
+      const switchzjr = resmodel.switchzjr;
       resmodel.switchzjr = '';
       const result = await resmodel.save();
       if (result) {
+        const newdata = { id: result.id, switchzjr };
         const { mq } = this.ctx;
         if (mq) {
           const exchange = 'switch_zb_' + id;
@@ -191,7 +193,7 @@ class RoomService extends CrudService {
             headers: {
               userid: result.id,
             } };
-          await mq.fanout(exchange, result.id, JSON.stringify(result), parm);
+          await mq.fanout(exchange, result.id, JSON.stringify(newdata), parm);
         }
       }
     }