初始化项目

This commit is contained in:
augushong
2020-08-07 23:49:50 +08:00
parent 30d8c3b64b
commit 3bc46a4b9c
304 changed files with 29675 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace app\command;
use app\model\Admin;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\helper\Str;
class ResetPassword extends Command
{
protected function configure()
{
// 指令配置
$this->setName('reset_password')
->setDescription('the reset_password command');
}
protected function execute(Input $input, Output $output)
{
// 指令输出
$account['salt'] = Str::random(6);
$account['password'] = md5('123456'.$account['salt']);
Admin::update($account,1);
$output->writeln('重置密码成功');
}
}