Skip to content

Commit

Permalink
Merge pull request #115 from wonder-game/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
linkunyuan authored Jun 13, 2024
2 parents 8aebff5 + 7d0c96a commit 05da49f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/Common/CloudLib/Storage/Tencent.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,18 @@ public function upload($file, $key, $options = [])
'Key' => $key,
'Body' => $stream
]);
return $result['Location'];

} catch (ServiceResponseException $e) {
trace(sprintf('%s, %s', $e, $e->getCosErrorType()), 'error');
} catch (\Exception $e) {
trace($e->getMessage(), 'error');
} finally {
is_resource($stream) && fclose($stream);
}
return false;
if ( ! empty($e)) {
throw $e;
}
return $result['Location'];
}

public function delete($key, $options = [])
Expand All @@ -90,7 +93,7 @@ public function uploadPart($file, $key, $partSize = 10 * 1024 * 1024, $options =
function doesObjectExist($key, $options = [])
{
try {
return $this->client->doesObjectExist($this->bucket,ltrim($key, '/'));
return $this->client->doesObjectExist($this->bucket, ltrim($key, '/'));
} catch (\Exception $e) {
trace($e->getMessage(), 'error');
throw $e;
Expand Down
8 changes: 1 addition & 7 deletions src/HttpController/BaseControllerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ protected function getLanguageConstants()
protected function _isRsaDecode($input = null)
{
$input = is_null($input) ? $this->input : $input;
$mode = 'model_' . get_mode('mode');
$Package = $mode('Package');
$package = $Package->cacheGet($input['pkgid']);
return ! empty($input[config('RSA.key')])
|| is_env('dev')
// 某些媒体或渠道包,无法加密通讯
|| ! empty(get_channel_byid($package['chid'] ?? 0, 'no_encrypt'));
return ! empty($input[config('RSA.key')]) || is_env('dev');
}

/**
Expand Down

0 comments on commit 05da49f

Please sign in to comment.