wzq 5 년 전
부모
커밋
7c1da83fa7
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      app/Http/Controllers/UeditorController.php

+ 3 - 4
app/Http/Controllers/UeditorController.php

@@ -24,8 +24,7 @@ class UeditorController extends Controller
             case 'uploadimage':
 
                 if($request->hasFile('upfile') && $request->file('upfile')->isValid()){
-//                    $path = $request->has('path') ? $request->path.'/' : date('Ym').'/';
-                    $path = $request['path'] ? $request['path'].'/' : date('Ym').'/';
+                    $path = $request->has('path') ? $request->path.'/' : date('Ym').'/';
                     //获取文件的原文件名 包括扩展名
                     $yuanname= $request->file('upfile')->getClientOriginalName();
                     $size = $request->file('upfile')->getSize();
@@ -37,8 +36,8 @@ class UeditorController extends Controller
                     $filename=time() . '_' . uniqid() .'.'.$kuoname;
 
                     $img = Image::make($filePath);
-                    if ($img->getWidth()>480) {
-                        $img->resize(480, null, function ($constraint) {
+                    if ($img->getWidth()>720) {
+                        $img->resize(720, null, function ($constraint) {
                             $constraint->aspectRatio();
                         });
                         $img->encode('jpg', 90);