Heim  >  Artikel  >  Backend-Entwicklung  >  apache - php分块上传现在还能用吗。

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

WBOY
WBOYOriginal
2016-06-06 20:08:22862Durchsuche

<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; 一直报签名错误

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn