调整了publish的事件的数据,返回event
This commit is contained in:
parent
cff668bfae
commit
05b8df221f
|
|
@ -164,7 +164,7 @@ class AppLoader extends types_1.AppLoader {
|
|||
const message = context.getMessage();
|
||||
await context.commit();
|
||||
return {
|
||||
opRecords: opRecords.map(ele => (0, lodash_1.omit)(ele, 'id')),
|
||||
opRecords,
|
||||
message,
|
||||
result,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -67,10 +67,10 @@ class DataSubscriber {
|
|||
const { instanceId } = (0, env_1.getClusterInfo)();
|
||||
// console.log('publishEvent', instanceId);
|
||||
if (sid) {
|
||||
this.ns.to(event).except(sid).emit('data', records);
|
||||
this.ns.to(event).except(sid).emit('data', records, event);
|
||||
}
|
||||
else {
|
||||
this.ns.to(event).emit('data', records);
|
||||
this.ns.to(event).emit('data', records, event);
|
||||
}
|
||||
}
|
||||
publishVolatileTrigger(entity, name, instanceNumber, ids, cxtStr, option) {
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Backe
|
|||
const message = context.getMessage();
|
||||
await context.commit();
|
||||
return {
|
||||
opRecords: (opRecords as CreateOpResult<ED, keyof ED>[]).map(ele => omit(ele, 'id')),
|
||||
opRecords,
|
||||
message,
|
||||
result,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -85,10 +85,10 @@ export default class DataSubscriber<ED extends EntityDict & BaseEntityDict, Cont
|
|||
const { instanceId } = getClusterInfo();
|
||||
// console.log('publishEvent', instanceId);
|
||||
if (sid) {
|
||||
this.ns.to(event).except(sid).emit('data', records);
|
||||
this.ns.to(event).except(sid).emit('data', records, event);
|
||||
}
|
||||
else {
|
||||
this.ns.to(event).emit('data', records);
|
||||
this.ns.to(event).emit('data', records, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue