Browse Source

bug fix wrong parameters when call HeroUnion api

master
filesite 8 months ago
parent
commit
360b7cb225
  1. 9
      themes/tajian/controller/FrontapiController.php

9
themes/tajian/controller/FrontapiController.php

@ -202,9 +202,9 @@ Class FrontApiController extends SiteController {
'url' => $shareUrl, 'url' => $shareUrl,
'platform' => $platform, 'platform' => $platform,
'contract' => $heroUnionConfig['contract'], 'contract' => $heroUnionConfig['contract'],
'data_mode' => $heroUnionConfig['contract'], 'data_mode' => $heroUnionConfig['data_mode'],
'country' => $heroUnionConfig['contract'], 'country' => $heroUnionConfig['country'],
'lang' => $heroUnionConfig['contract'], 'lang' => $heroUnionConfig['lang'],
'notify_url' => $heroUnionConfig['notify_url'], 'notify_url' => $heroUnionConfig['notify_url'],
); );
$params['sign'] = $this->sign($params, $heroUnionConfig['token']); $params['sign'] = $this->sign($params, $heroUnionConfig['token']);
@ -213,7 +213,8 @@ Class FrontApiController extends SiteController {
$timeout = 10; $timeout = 10;
$pc = false; $pc = false;
$headers = array("Content-Type: application/json"); $headers = array("Content-Type: application/json");
$res = $this->request($api, $params, $timeout, $pc, $headers); //以json格式post数据
$res = $this->request($api, json_encode($params), $timeout, $pc, $headers);
return !empty($res) && $res['status'] == 200 ? $res['result'] : false; return !empty($res) && $res['status'] == 200 ? $res['result'] : false;
} }

Loading…
Cancel
Save