From 2ae7efce0486a65fe406432871c27e7ec3252d6b Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Wed, 20 Jan 2021 19:19:28 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E7=AE=A1=E7=90=86=E5=AF=86=E7=A0=81=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catcher/command/Tools/BackupCommand.php | 5 --- .../catcher/command/Tools/InitRootCommand.php | 34 +++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 extend/catcher/command/Tools/InitRootCommand.php 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(); + } + } +}