moshaorui 1 mēnesi atpakaļ
vecāks
revīzija
a94e120885

+ 7 - 3
app/Admin/Controllers/SiteAlbumController.php

@@ -398,9 +398,13 @@ JS
      */
     private function autoGenerateCover($videoSrc)
     {
-        $cover = $videoSrc.'?x-oss-process=video/snapshot,t_2000,f_jpg,h_500,m_fast';
-        $cover = CommonHelper::ossUrl($cover);
-        $path = $this->upload($cover,'.jpg');
+        try {
+            $cover = $videoSrc.'?x-oss-process=video/snapshot,t_2000,f_jpg,h_500,m_fast';
+            $cover = CommonHelper::ossUrl($cover);
+            $path = $this->upload($cover,'.jpg');
+        } catch (\Exception $e) {
+            $path = ['status'=>true,'path'=>'/static/common/images/no-image.jpg'];
+        }
         return $path;
     }
 

+ 2 - 2
app/Admin/Controllers/SiteAlbumLogController.php

@@ -33,7 +33,7 @@ class SiteAlbumLogController extends AdminController
     {
         return Grid::make(new SiteAlbumLog(), function (Grid $grid) {
             $grid->column('id')->sortable();
-            $grid->column('nick_name');
+            $grid->column('user_name');
             $grid->column('action');
             $grid->column('model');
             $grid->column('content')->display(function ($value) {
@@ -72,7 +72,7 @@ class SiteAlbumLogController extends AdminController
     {
         return Show::make($id, new SiteAlbumLog(), function (Show $show) {
             $show->field('id');
-            $show->field('nick_name');
+            $show->field('user_name');
             $show->field('action');
             $show->field('model');
             $show->field('content');