更改插件卸载限制

This commit is contained in:
wangchen147 2023-12-18 14:38:08 +08:00
parent ed9f84a03a
commit ef01fcf32f

View File

@ -511,8 +511,10 @@ class CoreAddonInstallService extends CoreAddonBaseService
*/ */
public function uninstall() public function uninstall()
{ {
$site_num = (new Site())->where([ ['app', '=', $this->addon] ])->count('site_id'); if (!env('app_debug', true)) {
if ($site_num) throw new CommonException('APP_NOT_ALLOW_UNINSTALL'); $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'; $class = "addon\\" . $this->addon . "\\" . 'Addon';