* 產生簽名 * @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; }
怎麼這裡替換了第一次驗證簽名能過 第二次之後就直接報錯了 $this->tokenSecret; 一直報簽名錯誤
回複內容:
* 產生簽名 * @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; }
怎麼這裡替換了第一次驗證簽名能過 第二次之後就直接報錯了 $this->tokenSecret; 一直報簽名錯誤