diff --git a/plugin/think-plugs-account/stc/database/20241016000004_install_account20241016.php b/plugin/think-plugs-account/stc/database/20241010000005_install_account20241010.php similarity index 99% rename from plugin/think-plugs-account/stc/database/20241016000004_install_account20241016.php rename to plugin/think-plugs-account/stc/database/20241010000005_install_account20241010.php index df4d3309d..601078e6a 100644 --- a/plugin/think-plugs-account/stc/database/20241016000004_install_account20241016.php +++ b/plugin/think-plugs-account/stc/database/20241010000005_install_account20241010.php @@ -6,7 +6,7 @@ use think\migration\Migrator; @set_time_limit(0); @ini_set('memory_limit', -1); -class InstallAccount20241016 extends Migrator +class InstallAccount20241010 extends Migrator { /** diff --git a/plugin/think-plugs-admin/stc/database/20241016000003_install_admin20241016.php b/plugin/think-plugs-admin/stc/database/20241010000001_install_admin20241010.php similarity index 88% rename from plugin/think-plugs-admin/stc/database/20241016000003_install_admin20241016.php rename to plugin/think-plugs-admin/stc/database/20241010000001_install_admin20241010.php index 26134b4aa..389e385e1 100644 --- a/plugin/think-plugs-admin/stc/database/20241016000003_install_admin20241016.php +++ b/plugin/think-plugs-admin/stc/database/20241010000001_install_admin20241010.php @@ -14,10 +14,7 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- -use app\admin\Service; use think\admin\extend\PhinxExtend; -use think\admin\model\SystemConfig; -use think\admin\model\SystemUser; use think\migration\Migrator; @set_time_limit(0); @@ -26,7 +23,7 @@ use think\migration\Migrator; /** * 系统模块数据 */ -class InstallAdmin20241016 extends Migrator +class InstallAdmin20241010 extends Migrator { /** @@ -53,9 +50,6 @@ class InstallAdmin20241016 extends Migrator $this->_create_system_oplog(); $this->_create_system_queue(); $this->_create_system_user(); - $this->insertUser(); - $this->insertMenu(); - $this->insertConf(); } /** @@ -336,60 +330,4 @@ class InstallAdmin20241016 extends Migrator 'sort', 'status', 'username', 'is_deleted', ], true); } - - /** - * 初始化用户数据 - * @return void - */ - private function insertUser() - { - $model = SystemUser::mk()->whereRaw('1=1')->findOrEmpty(); - $model->isEmpty() && $model->save([ - 'id' => '10000', - 'username' => 'admin', - 'nickname' => '超级管理员', - 'password' => '21232f297a57a5a743894a0e4a801fc3', - 'headimg' => 'https://thinkadmin.top/static/img/head.png', - ]); - } - - /** - * 初始化配置参数 - * @return void - */ - private function insertConf() - { - $modal = SystemConfig::mk()->whereRaw('1=1')->findOrEmpty(); - $modal->isEmpty() && $modal->insertAll([ - ['type' => 'base', 'name' => 'app_name', 'value' => 'ThinkAdmin'], - ['type' => 'base', 'name' => 'app_version', 'value' => 'v6'], - ['type' => 'base', 'name' => 'editor', 'value' => 'ckeditor5'], - ['type' => 'base', 'name' => 'login_name', 'value' => '系统管理'], - ['type' => 'base', 'name' => 'site_copy', 'value' => '©版权所有 2014-' . date('Y') . ' ThinkAdmin'], - ['type' => 'base', 'name' => 'site_icon', 'value' => 'https://thinkadmin.top/static/img/logo.png'], - ['type' => 'base', 'name' => 'site_name', 'value' => 'ThinkAdmin'], - ['type' => 'base', 'name' => 'site_theme', 'value' => 'default'], - ['type' => 'storage', 'name' => 'allow_exts', 'value' => 'doc,gif,ico,jpg,mp3,mp4,p12,pem,png,zip,rar,xls,xlsx'], - ['type' => 'storage', 'name' => 'type', 'value' => 'local'], - ['type' => 'wechat', 'name' => 'type', 'value' => 'api'], - ]); - } - - /** - * 初始化系统菜单 - * @return void - */ - private function insertMenu() - { - // 初始化菜单数据 - PhinxExtend::write2menu([ - [ - 'name' => '系统管理', - 'sort' => '100', - 'subs' => Service::menu(), - ], - ], [ - 'url|node' => 'admin/config/index' - ]); - } } \ No newline at end of file diff --git a/plugin/think-plugs-admin/stc/database/20241010000002_install_admin20241011.php b/plugin/think-plugs-admin/stc/database/20241010000002_install_admin20241011.php new file mode 100644 index 000000000..bf704101f --- /dev/null +++ b/plugin/think-plugs-admin/stc/database/20241010000002_install_admin20241011.php @@ -0,0 +1,108 @@ +insertUser(); + $this->insertMenu(); + $this->insertConf(); + } + + /** + * 初始化用户数据 + * @return void + */ + private function insertUser() + { + $model = SystemUser::mk()->whereRaw('1=1')->findOrEmpty(); + $model->isEmpty() && $model->save([ + 'id' => '10000', + 'username' => 'admin', + 'nickname' => '超级管理员', + 'password' => '21232f297a57a5a743894a0e4a801fc3', + 'headimg' => 'https://thinkadmin.top/static/img/head.png', + ]); + } + + /** + * 初始化配置参数 + * @return void + */ + private function insertConf() + { + $modal = SystemConfig::mk()->whereRaw('1=1')->findOrEmpty(); + $modal->isEmpty() && $modal->insertAll([ + ['type' => 'base', 'name' => 'app_name', 'value' => 'ThinkAdmin'], + ['type' => 'base', 'name' => 'app_version', 'value' => 'v6'], + ['type' => 'base', 'name' => 'editor', 'value' => 'ckeditor5'], + ['type' => 'base', 'name' => 'login_name', 'value' => '系统管理'], + ['type' => 'base', 'name' => 'site_copy', 'value' => '©版权所有 2014-' . date('Y') . ' ThinkAdmin'], + ['type' => 'base', 'name' => 'site_icon', 'value' => 'https://thinkadmin.top/static/img/logo.png'], + ['type' => 'base', 'name' => 'site_name', 'value' => 'ThinkAdmin'], + ['type' => 'base', 'name' => 'site_theme', 'value' => 'default'], + ['type' => 'storage', 'name' => 'allow_exts', 'value' => 'doc,gif,ico,jpg,mp3,mp4,p12,pem,png,zip,rar,xls,xlsx'], + ['type' => 'storage', 'name' => 'type', 'value' => 'local'], + ['type' => 'wechat', 'name' => 'type', 'value' => 'api'], + ]); + } + + /** + * 初始化系统菜单 + * @return void + * @throws \Exception + */ + private function insertMenu() + { + + // 初始化菜单数据 + PhinxExtend::write2menu([ + [ + 'name' => '系统管理', + 'sort' => '100', + 'subs' => Service::menu(), + ], + ], [ + 'url|node' => 'admin/config/index' + ]); + } +} \ No newline at end of file diff --git a/plugin/think-plugs-center/stc/database/20241016000001_install_center20241016.php b/plugin/think-plugs-center/stc/database/20241010000004_install_center20241010.php similarity index 96% rename from plugin/think-plugs-center/stc/database/20241016000001_install_center20241016.php rename to plugin/think-plugs-center/stc/database/20241010000004_install_center20241010.php index 15d7307e5..3e4d887a5 100644 --- a/plugin/think-plugs-center/stc/database/20241016000001_install_center20241016.php +++ b/plugin/think-plugs-center/stc/database/20241010000004_install_center20241010.php @@ -15,7 +15,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; -class InstallCenter20241016 extends Migrator +class InstallCenter20241010 extends Migrator { /** diff --git a/plugin/think-plugs-payment/stc/database/20241016000005_install_payment20241016.php b/plugin/think-plugs-payment/stc/database/20241010000006_install_payment20241010.php similarity index 99% rename from plugin/think-plugs-payment/stc/database/20241016000005_install_payment20241016.php rename to plugin/think-plugs-payment/stc/database/20241010000006_install_payment20241010.php index 7941096f7..a6b5bcf3f 100644 --- a/plugin/think-plugs-payment/stc/database/20241016000005_install_payment20241016.php +++ b/plugin/think-plugs-payment/stc/database/20241010000006_install_payment20241010.php @@ -6,7 +6,7 @@ use think\migration\Migrator; @set_time_limit(0); @ini_set('memory_limit', -1); -class InstallPayment20241016 extends Migrator +class InstallPayment20241010 extends Migrator { /** diff --git a/plugin/think-plugs-wechat-service/stc/database/20241016000007_install_wechat_service20241016.php b/plugin/think-plugs-wechat-service/stc/database/20241010000009_install_wechat_service20241010.php similarity index 98% rename from plugin/think-plugs-wechat-service/stc/database/20241016000007_install_wechat_service20241016.php rename to plugin/think-plugs-wechat-service/stc/database/20241010000009_install_wechat_service20241010.php index 7f2ab727e..dcdc6d502 100644 --- a/plugin/think-plugs-wechat-service/stc/database/20241016000007_install_wechat_service20241016.php +++ b/plugin/think-plugs-wechat-service/stc/database/20241010000009_install_wechat_service20241010.php @@ -6,7 +6,7 @@ use think\migration\Migrator; @set_time_limit(0); @ini_set('memory_limit', -1); -class InstallWechatService20241016 extends Migrator +class InstallWechatService20241010 extends Migrator { /** diff --git a/plugin/think-plugs-wechat/stc/database/20241016000006_install_wechat20241016.php b/plugin/think-plugs-wechat/stc/database/20241010000003_install_wechat20241010.php similarity index 99% rename from plugin/think-plugs-wechat/stc/database/20241016000006_install_wechat20241016.php rename to plugin/think-plugs-wechat/stc/database/20241010000003_install_wechat20241010.php index 66cbf2409..8d4431305 100644 --- a/plugin/think-plugs-wechat/stc/database/20241016000006_install_wechat20241016.php +++ b/plugin/think-plugs-wechat/stc/database/20241010000003_install_wechat20241010.php @@ -6,7 +6,7 @@ use think\migration\Migrator; @set_time_limit(0); @ini_set('memory_limit', -1); -class InstallWechat20241016 extends Migrator +class InstallWechat20241010 extends Migrator { /** diff --git a/plugin/think-plugs-wemall/stc/database/20241016000002_install_wemall20241016.php b/plugin/think-plugs-wemall/stc/database/20241010000007_install_wemall20241010.php similarity index 99% rename from plugin/think-plugs-wemall/stc/database/20241016000002_install_wemall20241016.php rename to plugin/think-plugs-wemall/stc/database/20241010000007_install_wemall20241010.php index 726f76e0b..f155a5f4b 100644 --- a/plugin/think-plugs-wemall/stc/database/20241016000002_install_wemall20241016.php +++ b/plugin/think-plugs-wemall/stc/database/20241010000007_install_wemall20241010.php @@ -6,7 +6,7 @@ use think\migration\Migrator; @set_time_limit(0); @ini_set('memory_limit', -1); -class InstallWemall20241016 extends Migrator +class InstallWemall20241010 extends Migrator { /** diff --git a/plugin/think-plugs-wuma/stc/database/20241016000008_install_wuma20241016.php b/plugin/think-plugs-wuma/stc/database/20241010000008_install_wuma20241010.php similarity index 99% rename from plugin/think-plugs-wuma/stc/database/20241016000008_install_wuma20241016.php rename to plugin/think-plugs-wuma/stc/database/20241010000008_install_wuma20241010.php index 2b6849436..c0a834c04 100644 --- a/plugin/think-plugs-wuma/stc/database/20241016000008_install_wuma20241016.php +++ b/plugin/think-plugs-wuma/stc/database/20241010000008_install_wuma20241010.php @@ -6,7 +6,7 @@ use think\migration\Migrator; @set_time_limit(0); @ini_set('memory_limit', -1); -class InstallWuma20241016 extends Migrator +class InstallWuma20241010 extends Migrator { /**