diff --git a/src/jlgraphic/message/CentrifugeBroker.ts b/src/jlgraphic/message/CentrifugeBroker.ts index 3e9b1a7..9bb13c0 100644 --- a/src/jlgraphic/message/CentrifugeBroker.ts +++ b/src/jlgraphic/message/CentrifugeBroker.ts @@ -66,6 +66,10 @@ export class CentrifugeMessagingClient extends MessageClient { .on('subscribed', (ctx) => { console.log('订阅centrifuge服务消息成功', destination, ctx); }) + .on('unsubscribed', (ctx) => { + this.cli.removeSubscription(sub); + console.log('取消订阅centrifuge服务消息成功', destination, ctx); + }) .subscribe(); } else { sub.subscribe();