diff --git a/extend/catcher/command/Tools/BackupCommand.php b/extend/catcher/command/Tools/BackupCommand.php index a1af08b..2cf5ebb 100644 --- a/extend/catcher/command/Tools/BackupCommand.php +++ b/extend/catcher/command/Tools/BackupCommand.php @@ -3,16 +3,11 @@ declare (strict_types = 1); namespace catcher\command\Tools; -use catcher\CatchAdmin; -use catcher\facade\FileSystem; use catcher\library\BackUpDatabase; -use catcher\library\Zip; use think\console\Command; use think\console\Input; use think\console\input\Argument; -use think\console\input\Option; use think\console\Output; -use think\facade\Db; class BackupCommand extends Command { diff --git a/extend/catcher/command/Tools/InitRootCommand.php b/extend/catcher/command/Tools/InitRootCommand.php new file mode 100644 index 0000000..7cd6d30 --- /dev/null +++ b/extend/catcher/command/Tools/InitRootCommand.php @@ -0,0 +1,34 @@ +setName('catch:initAdmin') + ->setDescription('backup data you need'); + } + + protected function execute(Input $input, Output $output) + { + if ($user = Users::where('id', config('catch.permissions.super_admin_id'))->find()) { + + $user->password = 'catchadmin'; + + $user->save(); + } + } +}