lrf %!s(int64=2) %!d(string=hai) anos
pai
achega
e2e182a0c1
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/socket/ws.controller.ts

+ 2 - 2
src/socket/ws.controller.ts

@@ -2,7 +2,7 @@ import { App, Inject, OnWSConnection, OnWSDisConnection, OnWSMessage, WSControll
 import { Context } from '@midwayjs/ws';
 import * as http from 'http';
 import get = require('lodash/get');
-import group = require('lodash/group');
+import groupBy = require('lodash/groupBy');
 import { Application } from '@midwayjs/ws';
 import last = require('lodash/last');
 import { Types } from 'mongoose';
@@ -41,7 +41,7 @@ export class WsSocketController {
     if (!to) return;
     let list = await this.model.find({ to }).lean();
     list = list.map(i => ({ ...i, type: get(i, 'msg.type') }));
-    const groups = group(list, 'type');
+    const groups = groupBy(list, 'type');
     for (const key in groups) {
       const list = groups[key];
       const type = get(last(list), 'type');