Explorar o código

Merge branch 'master' into release

xielin %!s(int64=5) %!d(string=hai) anos
pai
achega
bc4a9f1446
Modificáronse 2 ficheiros con 9 adicións e 12 borrados
  1. 8 6
      app/Http/Controllers/UploadController.php
  2. 1 6
      app/Services/WechatService.php

+ 8 - 6
app/Http/Controllers/UploadController.php

@@ -25,15 +25,16 @@ class UploadController extends Controller
                 $width = Image::make($filePath)->width();
                 $height = Image::make($filePath)->height();
                 //要保存的文件名 时间+扩展名
-                $filename = time() . '_' . uniqid() . '.' . $kuoname . '?' . $width . '_' . $height;
+                $filename = time() . '_' . uniqid() . '.' . $kuoname;
+                $fileurl = $filename . '?' . $width . '_' . $height;
             } else {
                 //要保存的文件名 时间+扩展名
-                $filename = time() . '_' . uniqid() . '.' . $kuoname;
+                $fileurl = $filename = time() . '_' . uniqid() . '.' . $kuoname;
             }
             $imageUrl = Storage::put($path . $filename, file_get_contents($filePath));
             Log::debug('upload_url:' . $imageUrl);
             if ($imageUrl) {
-                return $this->jsonSuccess(['url' => config('customer.chxq_oss_url') . $path . $filename]);
+                return $this->jsonSuccess(['url' => config('customer.chxq_oss_url') . $path . $fileurl]);
             } else {
                 return $this->jsonError('图片上传失败,请重试');
             }
@@ -57,14 +58,15 @@ class UploadController extends Controller
                 $width = Image::make($filePath)->width();
                 $height = Image::make($filePath)->height();
                 //要保存的文件名 时间+扩展名
-                $filename = time() . '_' . uniqid() . '.' . $kuoname . '?' . $width . '_' . $height;
+                $filename = time() . '_' . uniqid() . '.' . $kuoname;
+                $fileurl = $filename . '?' . $width . '_' . $height;
             } else {
                 //要保存的文件名 时间+扩展名
-                $filename = time() . '_' . uniqid() . '.' . $kuoname;
+                $fileurl = $filename = time() . '_' . uniqid() . '.' . $kuoname;
             }
             $imageUrl = Storage::put($path . $filename, file_get_contents($filePath));
             if ($imageUrl) {
-                array_push($urls, config('customer.chxq_oss_url') . $path . $filename);
+                array_push($urls, config('customer.chxq_oss_url') . $path . $fileurl);
             } else {
                 Log::debug('文件上传失败。' . $filename);
             }

+ 1 - 6
app/Services/WechatService.php

@@ -18,13 +18,8 @@ class WechatService
 
     public function share($request)
     {
-        $type = true;
-        if(env('APP_ENV') == 'production'){
-            $type =false;
-        }
-
         $this->app->jssdk->setUrl($request['url']);
 
-        return $this->app->jssdk->buildConfig(['updateAppMessageShareData', 'updateTimelineShareData'], $type);
+        return $this->app->jssdk->buildConfig(['updateAppMessageShareData', 'updateTimelineShareData'], false);
     }
 }