
问题场景
在开发小程序中订阅功能时,出现的多步骤调用场景:
- 微信订阅API
- 查询是否登录
- 获取openId
- 发送订阅
上代码
function subscribe(){
Taro.requestSubscribeMessage()
.then(isLogin)
.then(getOpenid)
.then(postSubscript)
.catch((err)=>{
mes(err)
})
}