新增阿里云oss上传文件
This commit is contained in:
@@ -217,4 +217,44 @@ class Wechat
|
||||
throw new BusinessException($e->getMessage(), HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取分享二维码
|
||||
|
||||
/**
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws RedirectionExceptionInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws DecodingExceptionInterface
|
||||
* @throws ClientExceptionInterface
|
||||
* @throws TransportExceptionInterface
|
||||
* @throws ServerExceptionInterface
|
||||
*/
|
||||
public function getUnlimitedQRCode(array $options){
|
||||
try {
|
||||
$this->createApp($this->config['app_id'], $this->config['secret']);
|
||||
|
||||
$client = $this->createClient($this->config['app_id'], $this->config['secret']);
|
||||
|
||||
$response = $client->postJson('wxa/getwxacodeunlimit', $options);
|
||||
|
||||
if ($response->isFailed()) {
|
||||
// 出错了,处理异常
|
||||
$result = $response->toArray();
|
||||
if(empty($result)){
|
||||
// 返回值为空
|
||||
return [];
|
||||
}
|
||||
if (isset($result['errcode'])){
|
||||
throw new BusinessException();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
return $response->getContent(true);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
throw new BusinessException($e->getMessage(), HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user