mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2026-09-04 15:04:32 +08:00
fix: 修改php代码兼容5.4
This commit is contained in:
parent
955cb28427
commit
f27a6c7b1d
@ -284,7 +284,8 @@ abstract class BasicAliPay
|
||||
*/
|
||||
private function getSignContent(array $data, $needSignType = false)
|
||||
{
|
||||
list($attrs,) = [[], ksort($data)];
|
||||
ksort($data);
|
||||
$attrs = array();
|
||||
if (isset($data['sign'])) unset($data['sign']);
|
||||
if (empty($needSignType)) unset($data['sign_type']);
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
@ -191,7 +191,8 @@ class BasicWeChat
|
||||
return Tools::json2arr(Tools::post($url, $toJson ? Tools::arr2json($data) : $data, $options));
|
||||
} catch (InvalidResponseException $exception) {
|
||||
if (!$this->isTry && in_array($exception->getCode(), ['40014', '40001', '41001', '42001'])) {
|
||||
[$this->delAccessToken(), $this->isTry = true];
|
||||
$this->delAccessToken();
|
||||
$this->isTry = true;
|
||||
return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']);
|
||||
}
|
||||
throw new InvalidResponseException($exception->getMessage(), $exception->getCode());
|
||||
@ -235,7 +236,8 @@ class BasicWeChat
|
||||
} catch (InvalidResponseException $exception) {
|
||||
if (isset($this->currentMethod['method']) && empty($this->isTry)) {
|
||||
if (in_array($exception->getCode(), ['40014', '40001', '41001', '42001'])) {
|
||||
[$this->delAccessToken(), $this->isTry = true];
|
||||
$this->delAccessToken();
|
||||
$this->isTry = true;
|
||||
return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user