正在显示
1 个修改的文件
包含
8 行增加
和
4 行删除
| @@ -72,13 +72,17 @@ class TencentCosService extends BaseService | @@ -72,13 +72,17 @@ class TencentCosService extends BaseService | ||
| 72 | curl_setopt($curl, CURLOPT_INFILESIZE, filesize($url_path)); | 72 | curl_setopt($curl, CURLOPT_INFILESIZE, filesize($url_path)); |
| 73 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | 73 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
| 74 | // 发起请求 | 74 | // 发起请求 |
| 75 | - $response = curl_exec($curl); | 75 | + curl_exec($curl); |
| 76 | // 关闭文件流和CURL句柄 | 76 | // 关闭文件流和CURL句柄 |
| 77 | fclose($file); | 77 | fclose($file); |
| 78 | curl_close($curl); | 78 | curl_close($curl); |
| 79 | - var_dump($response); | ||
| 80 | - die(); | ||
| 81 | - return $response; | 79 | + // 检查响应状态码 |
| 80 | + $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); | ||
| 81 | + if ($httpCode == 200) { | ||
| 82 | + return 1; | ||
| 83 | + } else { | ||
| 84 | + return 2; | ||
| 85 | + } | ||
| 82 | } | 86 | } |
| 83 | 87 | ||
| 84 | /** | 88 | /** |
-
请 注册 或 登录 后发表评论