diff --git a/Application/Base/Tool/GameResource/YjlyClient.class.php b/Application/Base/Tool/GameResource/YjlyClient.class.php index 3048496bf..40afa1caf 100644 --- a/Application/Base/Tool/GameResource/YjlyClient.class.php +++ b/Application/Base/Tool/GameResource/YjlyClient.class.php @@ -89,6 +89,20 @@ class YjlyClient protected function sign($name, $params) { + $apiBizFieldMap = [ + 'mail' => 'mailData', + 'prop' => 'propData', + 'pay' => 'moneyFen', + ]; + $signFields = ['appId', 'serverId', 'roleId', 'userId', $apiBizFieldMap[$name], 'orderNum', 'time']; + $signArray = []; + foreach ($signFields as $field) { + $signArray[] = $params[$field]; + } + $signString = implode('', $signArray) . self::SIGN_KEY; + $this->log('SignString ' . $signString); + return md5($signString); + $signString = ''; $signString .= $params['appId']; $signString .= $params['serverId']; @@ -155,7 +169,7 @@ class YjlyClient } $result = $this->api('send-prop', [ 'roleId' => $order['role_id'], - 'propData' => json_encode($props), + 'propData' => $props, 'serverId' => $order['server_id'], 'userId' => $order['user_id'], 'orderNum' => $this->generateOrderNumber($order), @@ -190,7 +204,7 @@ class YjlyClient 'serverId' => $order['server_id'], 'roleId' => $order['role_id'], 'userId' => $order['user_id'], - 'mailData' => json_encode([['mailId' => $giftItem['id']]]), + 'mailData' => [['mailId' => $giftItem['id']]], 'orderNum' => date("YmdHis").$order['id'].$order['user_id'].$giftItem['id'].rand(1000, 9999), 'time' => time(), ]);