提交 4fb3b6c4 作者: wj

更新抖音SDK接口

上级 85e711b6
......@@ -74,22 +74,26 @@ class TTSDK {
this.isBind = 1;
return { code: code, message: msg }
}
this.LoginData = { ...this.LoginData, ...data };
const filters = (({ create_time, nickname, openid, uid, origin_uid = "", origin_open_id = "" }) => ({
this.LoginData = { ...this.LoginData, ...data, open_id: this.LoginData["openid"] };
const filters = (({ create_time, ip = "", nickname, open_id, uid, enter_game = true, origin_uid = "", origin_open_id = "" }) => ({
create_time,
ip,
nickname,
openid,
open_id,
uid,
enter_game,
origin_uid,
origin_open_id,
origin_open_id
}))(this.LoginData);
return {
...filters,
os: this.SDKCOMMDATA["os"], // 返回系统类型IOS或者android
login_code: "",
scene: this.LaunchOptions["scene"], // 用户来源场景值
from_appid: this.LaunchOptions["appId"] || this.LaunchOptions["appid"],
launchOptions: this.LaunchOptions,
user_status: data.user_status || 0,
game_club: 0 // 游戏圈开关
};
}
/**
......@@ -387,20 +391,20 @@ class TTSDK {
console.log("--SDK上报:", portData);
this.request(reportDomain, portData, "POST");
}
public sendPhoneCode = async (phoneInfo: any): Promise<any> => {
public phoneCode = async (phoneInfo: any, callback?: Function): Promise<any> => {
// 发送验证码接口
const { code } = await this.sdkRequest(ttLinks.sendCode, { ...this.SDKCOMMDATA, ...phoneInfo, type: "SDK.BIND_MOBILE" });
return { code: code == 0 };
callback && callback(code == 0);
}
public bindPhone = async (phoneInfo: any): Promise<any> => {
public userPhone = async (phoneInfo: any, callback?: Function): Promise<any> => {
// 绑定手机
const { code } = await this.sdkRequest(ttLinks.saveNum, { ...this.SDKCOMMDATA, open_id: this.LoginData["openid"], ...phoneInfo, source: "WEIXIN" });
return { code: code == 0 };
callback && callback(code == 0);
}
public checkUserPhoneBind = async (): Promise<any> => {
// 查询用户绑定状态
const { code } = await this.sdkRequest(ttLinks.bindPhone, { ...this.SDKCOMMDATA, uid: this.LoginData["uid"] });
return { code: code == 0 };
return code == 0;
}
// 获取用户信息
public getUserInfo = (): Promise<any> => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论