正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
| @@ -47,8 +47,10 @@ class TencentCosService extends BaseService | @@ -47,8 +47,10 @@ class TencentCosService extends BaseService | ||
| 47 | $contentType = 'image/'.$image_type; | 47 | $contentType = 'image/'.$image_type; |
| 48 | date_default_timezone_set('Asia/Shanghai'); | 48 | date_default_timezone_set('Asia/Shanghai'); |
| 49 | $date = date('D, d M Y H:i:s \G\M\T'); | 49 | $date = date('D, d M Y H:i:s \G\M\T'); |
| 50 | - $filePath = $path.'/'.$fileName; | ||
| 51 | $expiredTime = time() + 3600; | 50 | $expiredTime = time() + 3600; |
| 51 | + var_dump(date('Y-m-d H:i:s',$expiredTime)); | ||
| 52 | + die(); | ||
| 53 | + $filePath = $path.'/'.$fileName; | ||
| 52 | $stringToSign = "{$httpVerb}\n{$contentMd5}\n{$contentType}\n{$date}\n/{$this->config['bucket']}/{$filePath}"; | 54 | $stringToSign = "{$httpVerb}\n{$contentMd5}\n{$contentType}\n{$date}\n/{$this->config['bucket']}/{$filePath}"; |
| 53 | $sign = base64_encode(hash_hmac('sha1', $stringToSign, $this->config['secretKey'], true)); | 55 | $sign = base64_encode(hash_hmac('sha1', $stringToSign, $this->config['secretKey'], true)); |
| 54 | $authorization = "q-sign-algorithm=sha1&q-ak={$this->config['secretId']}&q-sign-time={$expiredTime}&q-key-time={$expiredTime}&q-header-list=&q-url-param-list=&q-signature={$sign}"; | 56 | $authorization = "q-sign-algorithm=sha1&q-ak={$this->config['secretId']}&q-sign-time={$expiredTime}&q-key-time={$expiredTime}&q-header-list=&q-url-param-list=&q-signature={$sign}"; |
-
请 注册 或 登录 后发表评论