作者 lyh

gx获取动态密码

1 -<?php  
2 -/**  
3 - * @remark :  
4 - * @name :DynamicPassword.php  
5 - * @author :lyh  
6 - * @method :post  
7 - * @time :2024/9/14 16:39  
8 - */  
9 -  
10 -namespace App\Console\Commands;  
11 -  
12 -use Illuminate\Console\Command;  
13 -use Illuminate\Support\Facades\Cache;  
14 -  
15 -class DynamicPassword extends Command  
16 -{  
17 - /**  
18 - * The name and signature of the console command.  
19 - *  
20 - * @var string  
21 - */  
22 - protected $signature = 'dynamic_password';  
23 -  
24 - /**  
25 - * The console command description.  
26 - *  
27 - * @var string  
28 - */  
29 - protected $description = '动态密码';  
30 -  
31 - /**  
32 - * Create a new command instance.  
33 - *  
34 - * @return void  
35 - */  
36 - public function __construct()  
37 - {  
38 - parent::__construct();  
39 - }  
40 -  
41 - public function handle(){  
42 - //设置登录动态密码  
43 - $str = generateRandomString(16);  
44 - Cache::put('dynamic_password',$str,5 * 3600);  
45 - return true;  
46 - }  
47 -}