1234567891011121314151617181920 |
- 'use strict';
- const Controller = require('egg').Controller;
- class HomeController extends Controller {
- async index() {
- const { ctx } = this;
- ctx.body = 'hi, egg';
- }
- async exitroom() {
- const { ctx } = this;
- const { uid, roomid } = this.ctx.query;
- const newdata = { uid, roomid };
- this.ctx.socket.emit('message', JSON.stringify(newdata));
- ctx.body = 'hi, egg';
- }
- }
- module.exports = HomeController;
|