diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md b/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md index e7205cb1ae17fb98b594a0b8ede1f01c11b50936..cac5176ad0112516fbcc559094b04bc629dacdef 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md @@ -299,11 +299,12 @@ function subscribeCB(err, data) { } // 创建订阅者回调 -function createCB(err, subscriber) { +function createCB(err, commonEventSubscriber) { if (err.code) { console.error(`createSubscriber failed, code is ${err.code}`); } else { console.info("createSubscriber"); + subscriber = commonEventSubscriber; // 订阅公共事件 CommonEvent.subscribe(subscriber, subscribeCB); } diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md index ca44566e18b198d3bc6da1c889b81145b03b6354..320fddb51d9a5d05354f50556929b90a66889000 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md @@ -335,9 +335,10 @@ function SubscribeCB(err, data) { } //创建订阅者回调 -function createCB(err, subscriber) { +function createCB(err, commonEventSubscriber) { if(!err) { console.info("createSubscriber"); + subscriber = commonEventSubscriber; //订阅公共事件 try { CommonEventManager.subscribe(subscriber, SubscribeCB); @@ -391,11 +392,12 @@ function subscribeCB(err, data) { } } //创建订阅者回调 -function createCB(err, subscriber) { +function createCB(err, commonEventSubscriber) { if (err) { console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`); } else { console.info("createSubscriber"); + subscriber = commonEventSubscriber; //订阅公共事件 try { CommonEventManager.subscribe(subscriber, subscribeCB);