提交 8eddfaaf 作者: 王进

phoneCode参数调整

上级 7a9096ea
/**
* 鲸鱼游戏微信小游戏接入库
* @author 推广技术部
* @time: 2019-09-25
* @time: 2019-11-14
*/
class WechatSDK {
private sdkVersion: string = '2.4'
public constructor() {
private sdkVersion: string = '2.5'
private constructor() {
this.sdkInit();
this.timerInit();
}
......@@ -310,7 +310,7 @@ class WechatSDK {
let bindType = await _selt.sdkRequest(Links.bindPhone, postData);
return (bindType.code == 0);
}
public async phoneCode(phoneInfo, callback) {
public async phoneCode(phoneInfo, callback?) {
const _selt = this;
let postData = this.deepCopy({}, _selt.sdkParams, phoneInfo);
postData.type = 'SDK.BIND_MOBILE'; // 小程序专属短信类型
......@@ -319,10 +319,8 @@ class WechatSDK {
console.log("@@SDK::验证码发送失败", err);
_selt.sdkAlert("发送失败,请重试..");
});
if (res.code == 0) {
callback(true);
} else {
callback(false);
if(callback) {
res.code == 0 ? callback(true) : callback(false);
}
}
public async userPhone(phoneInfo, callback) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论