修改插件
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yiqiu
2025-11-21 00:01:45 +08:00
parent 7bc68457e9
commit cbd6250967
224 changed files with 61713 additions and 18 deletions

View File

@@ -2,12 +2,13 @@
namespace addon\theme_configurator;
use addon\theme_configurator\model\ThemeConfigModel;
use app\common\lib\Plugin;
use think\facade\Db;
/**
* 主题可配置项插件主要类
*/
class ThemeConfigurator
class ThemeConfigurator extends Plugin
{
/** @var array 插件基础信息 */
public $info = [
@@ -37,18 +38,18 @@ class ThemeConfigurator
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"
);
} catch (\Throwable $throwable) {
return [
'status' => 400,
'msg' => $throwable->getMessage(),
];
$this->error = $throwable->getMessage();
return false;
}
(new ThemeConfigModel())->initConfig();
try {
(new ThemeConfigModel())->initConfig();
} catch (\Throwable $throwable) {
$this->error = $throwable->getMessage();
return false;
}
return [
'status' => 200,
'msg' => lang_plugins('theme_configurator_install_success'),
];
return true;
}
/**
@@ -60,16 +61,11 @@ class ThemeConfigurator
$table = ThemeConfigModel::tableName();
Db::execute("DROP TABLE IF EXISTS `{$table}`;");
} catch (\Throwable $throwable) {
return [
'status' => 400,
'msg' => $throwable->getMessage(),
];
$this->error = $throwable->getMessage();
return false;
}
return [
'status' => 200,
'msg' => lang_plugins('theme_configurator_uninstall_success'),
];
return true;
}
/**