作者 李宇航

合并分支 'master-server' 到 'master'

更新获取动态密码



查看合并请求 !766
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 -}  
@@ -30,16 +30,16 @@ class V6UpdateLogLogic extends BaseLogic @@ -30,16 +30,16 @@ class V6UpdateLogLogic extends BaseLogic
30 */ 30 */
31 public function saveV6UpdateLog(){ 31 public function saveV6UpdateLog(){
32 $this->param['operator_id'] = $this->manager['id']; 32 $this->param['operator_id'] = $this->manager['id'];
33 -// try { 33 + try {
34 if(isset($this->param['id']) && !empty($this->param['id'])){ 34 if(isset($this->param['id']) && !empty($this->param['id'])){
35 $id = $this->param['id']; 35 $id = $this->param['id'];
36 $this->model->edit($this->param,['id'=>$id]); 36 $this->model->edit($this->param,['id'=>$id]);
37 }else{ 37 }else{
38 $id = $this->model->addReturnId($this->param); 38 $id = $this->model->addReturnId($this->param);
39 } 39 }
40 -// }catch (\Exception $e){  
41 -// $this->fail('保存失败,请联系管理员,错误信息'.$e->getMessage());  
42 -// } 40 + }catch (\Exception $e){
  41 + $this->fail('保存失败,请联系管理员,错误信息'.$e->getMessage());
  42 + }
43 return $this->success(['id'=>$id]); 43 return $this->success(['id'=>$id]);
44 } 44 }
45 45