宿主监听小程序发送事件,调用小程序关闭的方法崩溃。
在方法外面写也一样崩溃,请问这是BUG,还是说代码问题?
mp.on('uniMPEvent', (event: string, data: object, notify) => {
console.log(`received mp message, event:${event}, message:${JSON.stringify(data)}`);
notify('received mp message success');
if (event === 'logout') {
try {
mp.close();
} catch (err) {
console.error(`close mp failed with error message: ${err.message}`);
throw new Error(`close mp failed with error message:${err.message}`);
}
}
})
0 个回复