Home  >  Article  >  Backend Development  >  apache - php分块上传现在还能用吗。

apache - php分块上传现在还能用吗。

WBOY
WBOYOriginal
2016-06-06 20:08:22861browse

<code>   * 生成签名
   * @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;
  }</code>

怎么这里替换了第一次验证签名能过 第二次之后就直接报错了 $this->tokenSecret; 一直报签名错误

回复内容:

<code>   * 生成签名
   * @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;
  }</code>

怎么这里替换了第一次验证签名能过 第二次之后就直接报错了 $this->tokenSecret; 一直报签名错误

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn