shish před 5 roky
rodič
revize
61ccd19727
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      common/services/ImageService.php

+ 4 - 1
common/services/ImageService.php

@@ -37,7 +37,7 @@ class ImageService
 
 
         Yii::info('url:' . $url);
         Yii::info('url:' . $url);
         //上传oss
         //上传oss
-        //oss::uploadImage($middle,$fullFileName);
+        oss::uploadImage($fileName,$fullFileName);
 
 
         $imgInfo = getimagesize($fullFileName);
         $imgInfo = getimagesize($fullFileName);
         if (empty($imgInfo) || isset($imgInfo[0]) == false) {
         if (empty($imgInfo) || isset($imgInfo[0]) == false) {
@@ -55,6 +55,9 @@ class ImageService
         }
         }
         $smallFullPathFile = $path . $middle . $middleName . '_small.jpg';
         $smallFullPathFile = $path . $middle . $middleName . '_small.jpg';
         Image::thumbnail($fullFileName, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
         Image::thumbnail($fullFileName, $smallWidth, $smallHeight)->save($smallFullPathFile, ['quality' => 100]);
+
+        oss::uploadImage($middle . $middleName . '_small.jpg',$smallFullPathFile);
+
         return $fileName;
         return $fileName;
     }
     }