修改分包oss文件上传

master
ELF 5 years ago
parent 744cbcf7ea
commit b217695c3f

@ -351,20 +351,27 @@ class GameSourceService {
'base_uri' => C('PACKAGE_CHUNK_URL'), 'base_uri' => C('PACKAGE_CHUNK_URL'),
'timeout' => 30.0, 'timeout' => 30.0,
]); ]);
$response = $client->post('/upload', [ try {
'verify' => false, $response = $client->post('/upload', [
'form_params' => [ 'verify' => false,
'file' => $localFilePath, 'form_params' => [
'dest' => $distFilePath, 'file' => $localFilePath,
'is_delete_local' => ($isDeleteLocal ? 1 : 0), 'dest' => $distFilePath,
] 'is_delete_local' => ($isDeleteLocal ? 1 : 0),
]); ]
$result = (string)$response->getBody(); ]);
$result = json_decode($result, true); $result = (string)$response->getBody();
if (!$result) { $result = json_decode($result, true);
if (!$result) {
return [
'status' => false,
'message' => '请求异常',
];
}
} catch (\Exception $e) {
return [ return [
'status' => false, 'status' => false,
'message' => '请求打包失败', 'message' => '请求异常: ' . $e->getMessage(),
]; ];
} }
return $result; return $result;

Loading…
Cancel
Save