diff --git a/plugin/admin/app/controller/VehicleController.php b/plugin/admin/app/controller/VehicleController.php index 0163f1b..eef7786 100644 --- a/plugin/admin/app/controller/VehicleController.php +++ b/plugin/admin/app/controller/VehicleController.php @@ -4,6 +4,7 @@ namespace plugin\admin\app\controller; use app\service\OssService; use plugin\admin\app\model\Location; +use support\Log; use support\Request; use support\Response; use plugin\admin\app\model\Vehicle; @@ -128,10 +129,25 @@ class VehicleController extends Crud $fbo_location = Location::find($item->fbo_locations_id); $item->fbo_location_name = $fbo_location ? $fbo_location->name : ''; - if(!str_starts_with($item['img_url'], 'http')){ +// if(!str_starts_with($item['img_url'], 'http')){ +// $ossservice = new OssService(); +// $img_url = $ossservice->generatePrivateUrl($item['img_url'], 3600); +// $item['img_url'] = $img_url; +// } + + try { $ossservice = new OssService(); $img_url = $ossservice->generatePrivateUrl($item['img_url'], 3600); + Log::info("Vehicle image URL generation:", [ + 'original_url' => $item['img_url'], + 'generated_url' => $img_url + ]); $item['img_url'] = $img_url; + } catch (\Exception $e) { + Log::error("Vehicle image URL generation failed:", [ + 'error' => $e->getMessage(), + 'original_url' => $item['img_url'] + ]); } }