提交 85db121b 作者: 王进

增加promise队列捕捉异常

上级 1b398ff0
...@@ -48,7 +48,7 @@ class WechatSDK { ...@@ -48,7 +48,7 @@ class WechatSDK {
Promise.all([p2, p3]).then(res => { Promise.all([p2, p3]).then(res => {
console.log("队列结束....") console.log("队列结束....")
that.getUserOpenId() that.getUserOpenId()
}, err => { console.log(err) }) }).catch(err => { console.log(err) })
} }
// 微信登录获取code,用code激活SDK换取openid // 微信登录获取code,用code激活SDK换取openid
private getUserOpenId() { private getUserOpenId() {
...@@ -497,6 +497,8 @@ class WechatSDK { ...@@ -497,6 +497,8 @@ class WechatSDK {
}, },
complete() { } complete() { }
})) }))
}).catch((error) => {
console.log(error)
}) })
} }
private async pay(params): Promise<any> { private async pay(params): Promise<any> {
...@@ -513,6 +515,8 @@ class WechatSDK { ...@@ -513,6 +515,8 @@ class WechatSDK {
console.log("Rechare") console.log("Rechare")
} }
})) }))
}).catch((error) => {
console.log(error)
}) })
} }
private shareInit() { private shareInit() {
...@@ -561,6 +565,8 @@ class WechatSDK { ...@@ -561,6 +565,8 @@ class WechatSDK {
reject(res) reject(res)
} }
}) })
}).catch((error) => {
console.log(error)
}) })
} }
// 获取启动参数 // 获取启动参数
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论