提交 8eddfaaf 作者: 王进

phoneCode参数调整

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