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');