|
@@ -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);
|