From c2894f51144293fa99abd54870720e5147ce55e9 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Thu, 2 Feb 2023 20:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Module.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Models/Module.php b/app/Models/Module.php index 0ae35e7..a85591a 100644 --- a/app/Models/Module.php +++ b/app/Models/Module.php @@ -52,8 +52,10 @@ protected static function boot() $model->api_token = Str::random(60); } - // 如果结尾有 / 则去掉 - $model->url = rtrim($model->url, '/'); + // 如果设置了 url 并且结尾有 / 则去掉 + if ($model->url) { + $model->url = rtrim($model->url, '/'); + } }); static::updating(function (self $model) { // 如果结尾有 / 则去掉