Sfoglia il codice sorgente

Merge branch 'develop' of http://git.caihongxingqiu.net/rainbow/config-manage into develop

duqinya 6 anni fa
parent
commit
ec4ac7a923
3 ha cambiato i file con 7 aggiunte e 4 eliminazioni
  1. 4 4
      app/Http/Controllers/UeditorController.php
  2. 2 0
      bootstrap/app.php
  3. 1 0
      config/customer.tpl

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

@@ -24,7 +24,7 @@ class UeditorController extends Controller
             case 'uploadimage':
 
                 if($request->hasFile('upfile') && $request->file('upfile')->isValid()){
-                    $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();
@@ -36,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);
@@ -51,7 +51,7 @@ class UeditorController extends Controller
                     if($imageUrl){
                         return [
                             'state' => 'SUCCESS',
-                                'url'   => config('common.oss').$path.$filename,
+                                'url'   => config('customer.chxq_oss_url').$path.$filename,
                                 'title' => $filename,
                                 'original'  => $yuanname,
                                 'type'  => $kuoname,

+ 2 - 0
bootstrap/app.php

@@ -30,6 +30,7 @@ $app = new Laravel\Lumen\Application(
  $app->configure('auth');
  $app->configure('jwt');
 $app->configure('database');
+$app->configure('customer');
 /*
 |--------------------------------------------------------------------------
 | Register Container Bindings
@@ -84,6 +85,7 @@ $app->register(App\Providers\AuthServiceProvider::class);
 $app->register(Dingo\Api\Provider\LumenServiceProvider::class);
 $app->register(Tymon\JWTAuth\Providers\LumenServiceProvider::class);
 $app->register(\Junliuxian\AliOSS\AliOssServiceProvider::class);
+$app->register(\Intervention\Image\ImageServiceProvider::class);
 
 /*
 |--------------------------------------------------------------------------

+ 1 - 0
config/customer.tpl

@@ -3,4 +3,5 @@
 return [
     'jwt_secret' => '{jwt_secret}',
     'manage_service_url' => '{manage_service_url}',
+    'chxq_oss_url' => '{chxq_oss_url}',
 ];