作者 Your Name
... ... @@ -34,7 +34,7 @@ class TestController extends BaseController
<p><a href="mailto:edinguas@gmail.com">Email:edinguas@gmail.com</a></p>';
$newsLogic = new NewsLogic();
$key = $newsLogic->processImage($test);
$this->response('success',Code::SUCCESS,$key);
$this->response('success',Code::SUCCESS,['key'=>$key]);
}
}
... ...
... ... @@ -234,10 +234,9 @@ class NewsLogic extends BaseLogic
if ($decodedData === false) {
continue; // 如果解码失败,则跳过
}
return $decodedData;
// 设置文件名
$outputFile = 'images/' . uniqid() . '.' . $imageType;
$filePath = __DIR__ . '/' . $outputFile;
// $outputFile = 'images/' . uniqid() . '.' . $imageType;
// $filePath = __DIR__ . '/' . $outputFile;
// 保存图片到服务器
// if (file_put_contents($filePath, $decodedData)) {
// // 生成图片URL
... ...