liuyu 4 年之前
父节点
当前提交
1e8e4a1878
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/controller/home.js

+ 3 - 2
app/controller/home.js

@@ -11,9 +11,10 @@ class HomeController extends Controller {
   async exitroom() {
     const { ctx } = this;
     const { uid, roomid } = this.ctx.query;
-    await this.ctx.controller.chat.index();
+    // await ctx.app.io.controller.chat.message();
     const newdata = { uid, roomid };
-    this.ctx.socket.emit('message', JSON.stringify(newdata));
+    ctx.app.io.of('/').emit('message', JSON.stringify(newdata));
+    // await this.ctx.socket.emit('message', JSON.stringify(newdata));
     ctx.body = 'hi, egg';
   }
 }