提交 9f540829 编写于 作者: 李光春's avatar 李光春

- 抖音支持上传到云存储

上级 4156f8a0
......@@ -84,7 +84,7 @@ class OssService extends Service
try {
$ossClient = new OssClient($this->accessKeyId, $this->accessKeySecret, $this->endpoint);
$ossClient->uploadFile($this->bucket, $object, $filePath);
return $this->app->config->get('dtapp.aliyun.oss.url') . $filePath;
return $this->app->config->get('dtapp.aliyun.oss.url') . $object;
} catch (OssException $e) {
return $e->getMessage();
}
......
......@@ -93,6 +93,6 @@ class BosService extends Service
// 从文件中直接上传Object
if (empty($this->bucket)) $this->getConfig();
$client->putObjectFromFile($this->bucket, $object, $filePath);
return $this->app->config->get('dtapp.baidu.bos.url') . $filePath;
return $this->app->config->get('dtapp.baidu.bos.url') . $object;
}
}
......@@ -24,6 +24,7 @@ use DtApp\ThinkLibrary\service\baidu\BosService;
use DtApp\ThinkLibrary\service\huaweicloud\ObsService;
use DtApp\ThinkLibrary\service\StorageService;
use DtApp\ThinkLibrary\service\tencent\CosService;
use Exception;
use stdClass;
/**
......@@ -192,6 +193,7 @@ class WatermarkService extends Service
/**
* 获取全部信息
* @return $this
* @throws Exception
*/
public function getAll()
{
......
......@@ -92,7 +92,7 @@ class ObsService extends Service
'SourceFile' => $filePath // localfile为待上传的本地文件路径,需要指定到具体的文件名
]);
if (isset($resp['RequestId'])) {
return $this->app->config->get('dtapp.huaweicloud.obs.url') . $filePath;
return $this->app->config->get('dtapp.huaweicloud.obs.url') . $object;
} else {
return false;
}
......
......@@ -102,6 +102,6 @@ class CosService extends Service
'Body' => $file)
);
}
return $this->app->config->get('dtapp.tencent.cos.url') . $filePath;
return $this->app->config->get('dtapp.tencent.cos.url') . $object;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册