项目相关接口、图片视频上传
This commit is contained in:
@@ -2,13 +2,18 @@
|
||||
|
||||
namespace App\Service\common\upload;
|
||||
|
||||
use App\BaseApp\BaseService;
|
||||
use Exception;
|
||||
use Qiniu\Auth;
|
||||
use Qiniu\Storage\BucketManager;
|
||||
use Qiniu\Storage\UploadManager;
|
||||
|
||||
class QiniuStorageService
|
||||
class QiniuStorageService extends BaseService
|
||||
{
|
||||
/**
|
||||
* @var mixed 单例实例,确保该类只有一个全局实例
|
||||
*/
|
||||
protected static mixed $_instance;
|
||||
private $accessKey;
|
||||
private $secretKey;
|
||||
private $bucket;
|
||||
@@ -16,10 +21,26 @@ class QiniuStorageService
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->accessKey = config('cc.oss.qiniu.access_key');
|
||||
$this->secretKey = config('cc.oss.qiniu.secret_key');
|
||||
$this->bucket = config('cc.oss.qiniu.bucket');
|
||||
$this->domain = config('cc.oss.qiniu.');
|
||||
$this->domain = config('cc.oss.qiniu.domain');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取实例
|
||||
* @return null|static
|
||||
*/
|
||||
public static function getInstance(): null|static
|
||||
{
|
||||
$name = get_called_class();
|
||||
if (!isset(self::$_instance[$name])) {
|
||||
self::$_instance[$name] = new static();
|
||||
}
|
||||
|
||||
return self::$_instance[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user