- 抖音支持上传到云存储

v6
Chaim 4 years ago
parent 4156f8a080
commit 9f5408293a

@ -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;
}
}

Loading…
Cancel
Save