牟新芬 4 лет назад
Родитель
Сommit
f95e8a6626

+ 1 - 1
app/api/controller/v1/Index.php

@@ -159,7 +159,7 @@ class Index extends BaseController
                     'width' => 280
                     'width' => 280
                 ]);
                 ]);
                 if (!$res) return app('json')->fail('二维码生成失败');
                 if (!$res) return app('json')->fail('二维码生成失败');
-                $upload = new Upload(2,config('upload')['stores']['qiniu']);
+                $upload = new Upload(2,config('qiniu')['upload']);
                 $res = $upload->to('routine/product')->validate()->stream($res, $name);
                 $res = $upload->to('routine/product')->validate()->stream($res, $name);
                 if ($res === false) {
                 if ($res === false) {
                     return app('json')->fail($upload->getError());
                     return app('json')->fail($upload->getError());

+ 2 - 2
app/system/controller/v1/Attachment.php

@@ -61,7 +61,7 @@ class Attachment extends BaseController
         ], $this->request, true);
         ], $this->request, true);
         try {
         try {
             $path = make_path('attach', 2, true);
             $path = make_path('attach', 2, true);
-            $upload = new Upload(2,config('upload')['stores']['qiniu']);
+            $upload = new Upload(2,config('qiniu')['upload']);
             $res = $upload->to($path)->validate()->move($file);
             $res = $upload->to($path)->validate()->move($file);
             if ($res === false) {
             if ($res === false) {
                 return app('json')->fail($upload->getError());
                 return app('json')->fail($upload->getError());
@@ -85,7 +85,7 @@ class Attachment extends BaseController
         $attinfo = AttachmentModel::get($att_id);
         $attinfo = AttachmentModel::get($att_id);
         if ($attinfo) {
         if ($attinfo) {
             try {
             try {
-                $upload = new Upload(2,config('upload')['stores']['qiniu']);
+                $upload = new Upload(2,config('qiniu')['upload']);
                 $upload->delete($attinfo['name']);
                 $upload->delete($attinfo['name']);
             } catch (\Throwable $e) {
             } catch (\Throwable $e) {
             }
             }

+ 7 - 0
config/qiniu.php

@@ -15,4 +15,11 @@ return [
     'endpoint'          => 'https://imgs.boofly.cn/',
     'endpoint'          => 'https://imgs.boofly.cn/',
     'bucket'            => 'live-product',
     'bucket'            => 'live-product',
     'bingW'             => true, //如果绑定域名请设置Ture,如果没有请设置flase
     'bingW'             => true, //如果绑定域名请设置Ture,如果没有请设置flase
+    'upload' => [
+        'accessKey'     => 'K-P9_cqutGZOchFKMMaNPStTQLnTP-xer97Qe2ug',
+        'secretKey'     => 'R_WUyYNp7K1CI8w5yqqVnQ0pOAQfE_E7cQ4nkZI2',
+        'uploadUrl'     => 'imgs.boofly.cn',
+        'storageName'   => 'live-product',
+        'storageRegion' => 's3-cn-south-1.qiniucs.com'
+    ]
 ];
 ];

+ 1 - 7
config/upload.php

@@ -17,12 +17,6 @@ return [
         //本地上传配置
         //本地上传配置
         'local' => [],
         'local' => [],
         //七牛云上传配置
         //七牛云上传配置
-        'qiniu' => [
-            'accessKey'     => 'K-P9_cqutGZOchFKMMaNPStTQLnTP-xer97Qe2ug',
-            'secretKey'     => 'R_WUyYNp7K1CI8w5yqqVnQ0pOAQfE_E7cQ4nkZI2',
-            'uploadUrl'     => 'imgs.boofly.cn',
-            'storageName'   => 'live-product',
-            'storageRegion' => 's3-cn-south-1.qiniucs.com'
-        ]
+        'qiniu' => []
     ]
     ]
 ];
 ];

+ 1 - 1
library/services/UtilService.php

@@ -325,7 +325,7 @@ class  UtilService {
                 $info['thumb_path'] = $wapCodePath;
                 $info['thumb_path'] = $wapCodePath;
                 return $info;
                 return $info;
             } else {
             } else {
-                $upload = new Upload(2,config('upload')['stores']['qiniu']);
+                $upload = new Upload(2,config('qiniu')['upload']);
                 $res = $upload->to($outfile)->validate()->stream($content, $name);
                 $res = $upload->to($outfile)->validate()->stream($content, $name);
                 if ($res === false) {
                 if ($res === false) {
                     return $upload->getError();
                     return $upload->getError();