* 生成签名 * @param $data * @param bool $isFormApiKey: 签名生成方式 e.g: true 使用表单API的key生成 * @return bool|string */ public function createSign($data, $isFormApiKey = true) { if(is_array($data)) { ksort($data); $string = ''; foreach($data as $k => $v) { $string .= "$k$v"; } $string .= $isFormApiKey ? $this->formApiKey : $this->tokenSecret; $sign = md5($string); dump($sign); return $sign; } return false; }
How did you replace the first verification signature? After the second time, the error will be directly $this->tokensecret; Always quote a signature error
Reply content:
* 生成签名 * @param $data * @param bool $isFormApiKey: 签名生成方式 e.g: true 使用表单API的key生成 * @return bool|string */ public function createSign($data, $isFormApiKey = true) { if(is_array($data)) { ksort($data); $string = ''; foreach($data as $k => $v) { $string .= "$k$v"; } $string .= $isFormApiKey ? $this->formApiKey : $this->tokenSecret; $sign = md5($string); dump($sign); return $sign; } return false; }
How did you replace the first verification signature? After the second time, the error will be directly $this->tokensecret; Always quote a signature error