3 changed files with 46 additions and 2 deletions
@ -0,0 +1,42 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
namespace app\command; |
|||
|
|||
use app\model\ApiLogModel; |
|||
use think\console\Command; |
|||
use think\console\Input; |
|||
use think\console\Output; |
|||
use think\facade\Cache; |
|||
use think\facade\Log; |
|||
|
|||
class TestCommand extends Command |
|||
{ |
|||
protected function configure() |
|||
{ |
|||
// 指令配置 |
|||
$this->setName('test') |
|||
->setDescription('the test command'); |
|||
} |
|||
/** |
|||
* Execute the console command. |
|||
* |
|||
* @param Input $input |
|||
* @param Output $output |
|||
* @return void |
|||
*/ |
|||
protected function execute(Input $input, Output $output) |
|||
{ |
|||
$cacheCode = Cache::store('redis')->keys('api_log'); |
|||
dd($cacheCode); |
|||
$param['nation'] = '81'; |
|||
$param['phone'] = '8057252138'; |
|||
$mobile = $param['nation'] . ltrim($param['phone'], '0'); |
|||
|
|||
$smsKey = 'DB:USER:UNLOGIN:SMS_CODE:' . $mobile; |
|||
$cacheCode = Cache::store('redis')->get($smsKey); |
|||
dd($cacheCode); |
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue