From ff41f5c0410eb7c42aa799de3e7e48fb554bdf7a Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 26 Feb 2025 11:58:53 +0800 Subject: [PATCH] no message --- app/Tasks/BotReceiveMsgTask.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Tasks/BotReceiveMsgTask.php b/app/Tasks/BotReceiveMsgTask.php index fe83fe877..d65c1525e 100644 --- a/app/Tasks/BotReceiveMsgTask.php +++ b/app/Tasks/BotReceiveMsgTask.php @@ -443,8 +443,13 @@ class BotReceiveMsgTask extends AbstractTask if ($type === 'wenxin') { $extras['api_key'] .= ':' . $setting['wenxin_secret']; } - if ($type === 'ollama' && empty($extras['api_key'])) { - $extras['api_key'] = Base::strRandom(6); + if ($type === 'ollama') { + if (empty($extras['base_url'])) { + $errorContent = '机器人未启用。'; + } + if (empty($extras['api_key'])) { + $extras['api_key'] = Base::strRandom(6); + } } if (empty($extras['api_key'])) { $errorContent = '机器人未启用。';