@@ -129,4 +129,14 @@ class OssService extends Service
return $url;
}
+
+ // 阿里云上是否存在图片
+ public function isIsset($objectKey){
+ // 初始化OSS客户端
+ $ossClient = new OssClient($this->accessKeyId, $this->accessKeySecret, $this->endpoint);
+ if ($ossClient->doesObjectExist($this->bucket, $objectKey)) return true;
+ return false;
+ }