From 6a59eda4b31635e6af792ddd1f941dc1796fee79 Mon Sep 17 00:00:00 2001 From: baji Date: Thu, 6 Mar 2025 15:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Index.php | 6 +++++- route/app.php | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 4e28e8f..e5f74b6 100755 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -155,7 +155,11 @@ class Index extends Base $wxServer = new \app\common\server\Wx($this->app); $user_base = $wxServer->generateUrlLinks($userId); $autoload = new \app\common\server\autoload(); - $imageData = $autoload->generatePosterWithQR('public/img_poster.jpg', $user_base); + $currentDir = getcwd(); + // $absolutePath = $currentDir . '/public/img_poster.jpg'; + // ///www/wwwroot/testbaji.onelight.vip/app/public/img_poster.jpg + // //www/wwwroot/testbaji.onelight.vip/public/public/img_poster.jpg + $imageData = $autoload->generatePosterWithQR( $currentDir . '/img_poster.jpg', $user_base); if ($imageData) { header('Content-Type: image/png'); header('Content-Length: ' . strlen($imageData)); // 设置图像长度,帮助浏览器处理流式内容 diff --git a/route/app.php b/route/app.php index 2041568..6a232c6 100755 --- a/route/app.php +++ b/route/app.php @@ -11,7 +11,10 @@ use think\facade\Route; Route::get('think', function () { - return 'hello,ThinkPHP6!'; + // $absolutePath = realpath('./public/img_poster.jpg'); + $currentDir = getcwd(); + $absolutePath = $currentDir . '/public/img_poster.jpg'; + return $absolutePath; }); Route::get('hello/:name', 'index/hello');