diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 8cf22c41..16e0d027 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -29,6 +29,9 @@ class Controller extends BaseController return $this->error($e->getMessage()); } catch (\Throwable $e) { Log::error("Web 上传文件时发生异常,", ['message' => $e->getMessage(), 'trace' => $e->getTraceAsString()]); + if (config('app.debug')) { + return $this->error($e->getMessage()); + } return $this->error('服务异常,请稍后再试'); } return $this->success('上传成功', $image->setAppends(['pathname', 'links'])->only( diff --git a/app/Http/Controllers/User/ImageController.php b/app/Http/Controllers/User/ImageController.php index 1d4122ff..4f4f5f94 100644 --- a/app/Http/Controllers/User/ImageController.php +++ b/app/Http/Controllers/User/ImageController.php @@ -108,7 +108,7 @@ class ImageController extends Controller } catch (FilesystemException $e) { abort(404); } - // 是否启用了水印功能 + // 是否启用了水印功能 TODO 跳过gif if ($image->group->configs->get(GroupConfigKey::IsEnableWatermark)) { // TODO 缓存水印文件 $configs = $image->group->configs->get(GroupConfigKey::WatermarkConfigs); diff --git a/app/Service/ImageService.php b/app/Service/ImageService.php index a0c1cf6f..724b0a3a 100644 --- a/app/Service/ImageService.php +++ b/app/Service/ImageService.php @@ -252,7 +252,7 @@ class ImageService */ private function getWatermark(string $driver, Collection $options): \Intervention\Image\Image { - $manager = new ImageManager(); + $manager = new ImageManager(config('image')); if ($driver === 'image') { $watermark = $manager->make($options->get(ImageOption::Image)); diff --git a/public/css/app.css b/public/css/app.css index c2d9dc1e..0f27c730 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -1481,14 +1481,14 @@ select { --tw-text-opacity: 1; color: rgb(209 213 219 / var(--tw-text-opacity)); } -.text-gray-900 { - --tw-text-opacity: 1; - color: rgb(17 24 39 / var(--tw-text-opacity)); -} .text-green-600 { --tw-text-opacity: 1; color: rgb(22 163 74 / var(--tw-text-opacity)); } +.text-gray-900 { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} .text-blue-500 { --tw-text-opacity: 1; color: rgb(59 130 246 / var(--tw-text-opacity));