Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
2 个修改的文件
包含
14 行增加
和
5 行删除
| @@ -53,7 +53,7 @@ if (!function_exists('http_post')) { | @@ -53,7 +53,7 @@ if (!function_exists('http_post')) { | ||
| 53 | * @param type $url | 53 | * @param type $url |
| 54 | * @param type $post_data | 54 | * @param type $post_data |
| 55 | */ | 55 | */ |
| 56 | - function http_post($url, $post_data, $header = []) | 56 | + function http_post($url, $post_data, $header = [],$is_json = true) |
| 57 | { | 57 | { |
| 58 | if (empty($header)) { | 58 | if (empty($header)) { |
| 59 | $header = array( | 59 | $header = array( |
| @@ -78,7 +78,10 @@ if (!function_exists('http_post')) { | @@ -78,7 +78,10 @@ if (!function_exists('http_post')) { | ||
| 78 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($error_message, true) . PHP_EOL, FILE_APPEND); | 78 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($error_message, true) . PHP_EOL, FILE_APPEND); |
| 79 | } | 79 | } |
| 80 | curl_close($ch); | 80 | curl_close($ch); |
| 81 | - return json_decode($res, true); | 81 | + if($is_json){ |
| 82 | + return json_decode($res, true); | ||
| 83 | + } | ||
| 84 | + return $res; | ||
| 82 | } | 85 | } |
| 83 | } | 86 | } |
| 84 | 87 |
| @@ -314,9 +314,15 @@ class LoginController extends BaseController | @@ -314,9 +314,15 @@ class LoginController extends BaseController | ||
| 314 | public function ceshi(){ | 314 | public function ceshi(){ |
| 315 | //同步到大文件 | 315 | //同步到大文件 |
| 316 | $path = '/upload/m/video/2023-08'; | 316 | $path = '/upload/m/video/2023-08'; |
| 317 | - $fileName = '64e81b9b80b13315901.mp4'; | 317 | + $fileName = '64e81b9b80b1331590.mp4'; |
| 318 | $file_path = config('filesystems.disks.cos')['cdn1'].$path.'/'.$fileName; | 318 | $file_path = config('filesystems.disks.cos')['cdn1'].$path.'/'.$fileName; |
| 319 | - $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$path.'" https://v6-file.globalso.com/upload.php'; | ||
| 320 | - return shell_exec($cmd); | 319 | + $param = [ |
| 320 | + 'file_path'=>$file_path, | ||
| 321 | + 'save_path'=>'/www/wwwroot/cos'.$path | ||
| 322 | + ]; | ||
| 323 | + $url = 'https://v6-file.globalso.com/upload.php'; | ||
| 324 | + http_post($url,$param,['charset=utf-8'],false); | ||
| 325 | +// $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$path.'" https://v6-file.globalso.com/upload.php'; | ||
| 326 | +// return shell_exec($cmd); | ||
| 321 | } | 327 | } |
| 322 | } | 328 | } |
-
请 注册 或 登录 后发表评论