From 360b7cb2254b065e1a8e45a1486d734996d08e79 Mon Sep 17 00:00:00 2001 From: filesite Date: Sat, 13 Apr 2024 21:52:54 +0800 Subject: [PATCH] bug fix wrong parameters when call HeroUnion api --- themes/tajian/controller/FrontapiController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index dda9fc6..489f96e 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -202,9 +202,9 @@ Class FrontApiController extends SiteController { 'url' => $shareUrl, 'platform' => $platform, 'contract' => $heroUnionConfig['contract'], - 'data_mode' => $heroUnionConfig['contract'], - 'country' => $heroUnionConfig['contract'], - 'lang' => $heroUnionConfig['contract'], + 'data_mode' => $heroUnionConfig['data_mode'], + 'country' => $heroUnionConfig['country'], + 'lang' => $heroUnionConfig['lang'], 'notify_url' => $heroUnionConfig['notify_url'], ); $params['sign'] = $this->sign($params, $heroUnionConfig['token']); @@ -213,7 +213,8 @@ Class FrontApiController extends SiteController { $timeout = 10; $pc = false; $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; }