From 451334d428ad09c02e97840bd2e80c24f6cb6ca4 Mon Sep 17 00:00:00 2001 From: EasyChen Date: Mon, 31 Jan 2022 16:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0type=E4=B8=BAimage=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E9=80=9A=E7=9F=A5=E6=96=87=E6=A1=88=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ api/app/Http/Controllers/PushDeerMessageController.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 582d5b0..0601a66 100644 --- a/README.md +++ b/README.md @@ -357,6 +357,8 @@ API_BASE=http://127.0.0.1:8800 |desp|消息内容第二部分,选填| |type|格式,选填|文本=text,markdown,图片=image,默认为markdown| +type 为 image 时,text 中为要发送图片的URL。 + #### 获得当前用户的消息列表 `POST /message/list` diff --git a/api/app/Http/Controllers/PushDeerMessageController.php b/api/app/Http/Controllers/PushDeerMessageController.php index 024056b..160fa2b 100644 --- a/api/app/Http/Controllers/PushDeerMessageController.php +++ b/api/app/Http/Controllers/PushDeerMessageController.php @@ -60,6 +60,10 @@ class PushDeerMessageController extends Controller $validated['type'] = 'markdown'; } + if (strtolower($validated['type'])=='image') { + $validated['text'] = '[图片]'; + } + $key = PushDeerKey::where('key', $validated['pushkey'])->get()->first(); $result = [];