diff --git a/README.md b/README.md index 7023099..f5b0a1f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ composer require tm-wms/message-notify ## 配置文件 -发布配置文件`config/message_notify.php` +发布配置文件`config/message_notify.php` 具体配置message_notify.php ```sh php bin/hyperf.php vendor:publish tm-wms/message-notify diff --git a/publish/message_notify.php b/publish/message_notify.php index 61ca2db..3f17855 100644 --- a/publish/message_notify.php +++ b/publish/message_notify.php @@ -19,7 +19,7 @@ return [ Notify::INFO => [ 'token' => env('NOTIFY_DINGTALK_TOKEN', ''), 'secret' => env('NOTIFY_DINGTALK_SECRET', ''), - 'keyword' => env('NOTIFY_DINGTALK_KEYWORD', ['test']), + 'keyword' => env('NOTIFY_DINGTALK_KEYWORD', ['']), ], // 错误信息告警群 Notify::ERROR => [ diff --git a/src/Notify.php b/src/Notify.php index 57c66fc..9e6d5d3 100644 --- a/src/Notify.php +++ b/src/Notify.php @@ -26,6 +26,9 @@ class Notify public static function make(?AbstractChannel $channel = null): Connection { + $default = env('NOTIFY_DEFAULT_CHANNEL'); + $channels = config('message_notify.channels'); + $channel = $channel ?? make($channels[$default]['channel'] ?? null); return make(Connection::class, [ $channel ]);