From ef01fcf32f349b0ca716f49bd55f3fac2b33ec32 Mon Sep 17 00:00:00 2001 From: wangchen147 <30853657+wangchen147@users.noreply.github.com> Date: Mon, 18 Dec 2023 14:38:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=8F=92=E4=BB=B6=E5=8D=B8?= =?UTF-8?q?=E8=BD=BD=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- niucloud/app/service/core/addon/CoreAddonInstallService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/niucloud/app/service/core/addon/CoreAddonInstallService.php b/niucloud/app/service/core/addon/CoreAddonInstallService.php index 368ac960b..abb8c7692 100644 --- a/niucloud/app/service/core/addon/CoreAddonInstallService.php +++ b/niucloud/app/service/core/addon/CoreAddonInstallService.php @@ -511,8 +511,10 @@ class CoreAddonInstallService extends CoreAddonBaseService */ public function uninstall() { - $site_num = (new Site())->where([ ['app', '=', $this->addon] ])->count('site_id'); - if ($site_num) throw new CommonException('APP_NOT_ALLOW_UNINSTALL'); + if (!env('app_debug', true)) { + $site_num = (new Site())->where([['app', '=', $this->addon]])->count('site_id'); + if ($site_num) throw new CommonException('APP_NOT_ALLOW_UNINSTALL'); + } //执行插件卸载方法 $class = "addon\\" . $this->addon . "\\" . 'Addon';