diff --git a/app/common/controller/UsedCarController.php b/app/common/controller/UsedCarController.php index 3e4955d..b8d4603 100644 --- a/app/common/controller/UsedCarController.php +++ b/app/common/controller/UsedCarController.php @@ -395,16 +395,9 @@ class UsedCarController extends BaseController if (!file_exists($publicFile)) { copy($filePath, $publicFile); } - - // 从连接中获取协议(最可靠) - $connection = $request->connection; - $protocol = 'https'; - if ($connection && property_exists($connection, 'transport')) { - $protocol = $connection->transport === 'ssl' ? 'https' : 'http'; - } // 返回访问地址 - $baseUrl = $protocol.'://' . request()->header('host'); + $baseUrl = 'https://' . request()->header('host'); $url = $baseUrl . '/pdf/' . $raw['pdf_src']; return $this->success([