雕兄
雕兄
我的也是这个问题,请问怎解决呢?
我是这样可以实现 @Get('/index') async index(): Promise { this.ctx.status = 200; this.ctx.set('Content-Type', 'text/event-stream'); this.ctx.set('Cache-Control', 'no-cache, no-transform'); this.ctx.set('Connection', 'keep-alive'); this.ctx.set('X-Accel-Buffering', 'no'); this.ctx.res.write('data: {"status":200}' + '\n\n'); // 创建一个不会被解决的 Promise,防止 Koa 自动结束响应 return new Promise((resolve,...
是的,兄弟你解决了吗?