|
@@ -61,14 +61,7 @@ class Attachment extends BaseController
|
|
|
], $this->request, true);
|
|
|
try {
|
|
|
$path = make_path('attach', 2, true);
|
|
|
- $config = [
|
|
|
- 'accessKey' => config('qiniu')['accessKeyId'],
|
|
|
- 'secretKey' => config('qiniu')['accessKeySecret'],
|
|
|
- 'uploadUrl' => 'imgs.boofly.cn',
|
|
|
- 'storageName' => config('qiniu')['bucket'],
|
|
|
- 'storageRegion' => 's3-cn-south-1.qiniucs.com',
|
|
|
- ];
|
|
|
- $upload = new Upload(2,$config);
|
|
|
+ $upload = new Upload(2,config('upload')['stores']['qiniu']);
|
|
|
$res = $upload->to($path)->validate()->move($file);
|
|
|
if ($res === false) {
|
|
|
return app('json')->fail($upload->getError());
|
|
@@ -92,14 +85,7 @@ class Attachment extends BaseController
|
|
|
$attinfo = AttachmentModel::get($att_id);
|
|
|
if ($attinfo) {
|
|
|
try {
|
|
|
- $config = [
|
|
|
- 'accessKey' => config('qiniu')['accessKeyId'],
|
|
|
- 'secretKey' => config('qiniu')['accessKeySecret'],
|
|
|
- 'uploadUrl' => 'imgs.boofly.cn',
|
|
|
- 'storageName' => config('qiniu')['bucket'],
|
|
|
- 'storageRegion' => 's3-cn-south-1.qiniucs.com',
|
|
|
- ];
|
|
|
- $upload = new Upload(2,$config);
|
|
|
+ $upload = new Upload(2,config('upload')['stores']['qiniu']);
|
|
|
$upload->delete($attinfo['name']);
|
|
|
} catch (\Throwable $e) {
|
|
|
}
|