sdk:修复登录接口

This commit is contained in:
luying
2021-11-12 16:10:20 +08:00
parent 3a45e8457f
commit c62cd91a10
9 changed files with 38 additions and 29 deletions

View File

@@ -745,4 +745,4 @@ export enum THINKING_DATA_MODE_LIST {
BATCH = 'batch',
LOGGING = 'logging',
}
export const THINKING_DATA_MODE = THINKING_DATA_MODE_LIST.DEBUG;
export let THINKING_DATA_MODE = THINKING_DATA_MODE_LIST.BATCH;

View File

@@ -59,7 +59,7 @@ export function loadWar() {
arr.forEach(o => {
o.fixReward = parseFixReward(o.fixReward);
o.conditionReward = parseConditionReward(o.conditionReward);
o.parseRandomReward = parseRandomReward(o.parseRandomReward);
o.parseRandomReward = parseRandomReward(o.RandomReward||o.randomReward);
o.detailUIBg = parseDetailUIBg(o.detailUIBg);
o.jackpotReward = parseJackpotReward(o.jackpotReward);
o.teammateReward = parseFixReward(o.teammateReward);

View File

@@ -20,7 +20,7 @@ export async function httpRequest(url: string, method: string, body: any, header
url,
method,
headers,
body,
body: JSON.stringify(body),
timeout,
JSON: true
}
@@ -152,7 +152,7 @@ export async function vidHttpRequest(addr: string, body: any) {
export async function request37(url: string, body: any, key: string) {
body['sign'] = get37Md5Sign(body, key);
let result = await httpRequest(url, HTTP_METHOD.POST, body, {});
let result = await httpRequestForm(url, HTTP_METHOD.POST, body, 1000);
console.log('******result', result)
return result;
}

View File

@@ -54,8 +54,8 @@ export function get37PostMd5Sign(body: any, key: string) {
return getMd5ObjSign(body, '', (str) => `${str}${key}`);
}
export async function loginValidate37(clientId: string, pst: string, platformAppid: string, childGameId: number) {
let result: LoginValidataReturn37 = await request37(SDK_37_ADDR.LOGIN, {
export async function loginValidate37(clientId: string, pst: string, platformAppid: string = SDK_37_CONST.PID, childGameId: number = SDK_37_CONST.FX_C_GAME_ID) {
let result: string = await request37(SDK_37_ADDR.LOGIN, {
clientid: clientId,
pid: platformAppid,
game_id: SDK_37_CONST.GAME_ID,
@@ -63,11 +63,18 @@ export async function loginValidate37(clientId: string, pst: string, platformApp
time: nowSeconds(),
c_game_id: childGameId
}, SDK_37_CONST.LOGIN_KEY);
if (result && result.code !== 1) {
console.error(result.msg);
let json: LoginValidataReturn37;
try {
json = JSON.parse(result);
}catch(e) {
console.log(e);
}
if (json && json.code !== 1) {
console.error(json.msg);
}
return result;
return json;
}
export async function loginValidata(channelType: string, params: { clientId: string, pst: string, platformAppid: string, childGameId: number }) {