优化
This commit is contained in:
@@ -111,7 +111,6 @@ class Addons extends \think\Model {
|
||||
public static function uninstall($id) {
|
||||
$info = self::find($id);
|
||||
if (!$info) {
|
||||
$this->error = "无此插件!";
|
||||
return false;
|
||||
}
|
||||
$class = get_addons_class($info['name']);
|
||||
@@ -119,7 +118,6 @@ class Addons extends \think\Model {
|
||||
//插件卸载方法
|
||||
$addons = get_addons_instance($info['name']);
|
||||
if (!method_exists($addons, 'uninstall')) {
|
||||
$this->error = "插件卸载方法!";
|
||||
return false;
|
||||
}
|
||||
$result = $addons->uninstall();
|
||||
@@ -130,7 +128,6 @@ class Addons extends \think\Model {
|
||||
$info->save(['isinstall' => 0]);
|
||||
return true;
|
||||
} else {
|
||||
$this->error = "无法卸载插件!";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user