作者 赵彬吉

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

<?php
/**
* @remark :
* @name :DomainInfo.php
* @author :lyh
* @method :post
* @time :2023/9/11 14:37
*/
namespace App\Console\Commands\Domain;
use Illuminate\Console\Command;
use App\Models\Domain\DomainInfo as DomainInfoModel;
class DomainInfo extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'domain_info';
/**
* The console command description.
*
* @var string
*/
protected $description = '域名相关';
public function handle(){
$domainModel = new DomainInfoModel();
$map = [];
$list = $domainModel->list($map);
$context = stream_context_create([
'ssl' => [
'capture_peer_cert' => true,
'capture_peer_cert_chain' => false,
],
]);
$stream = stream_socket_client('ssl://oa.quanqiusou.cn:443', $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);
if(!$stream) {
die("Failed to connect: $errno - $errstr");
}
$remote_cert = stream_context_get_params($stream)['options']['ssl']['peer_certificate'];
if(!$remote_cert) {
die("Failed to retrieve certificate");
}
$valid_from = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validFrom_time_t']);
$valid_to = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validTo_time_t']);
fclose($stream);
echo "Certificate Valid From: $valid_from<br>";
echo "Certificate Valid To: $valid_to<br>";
}
}
... ...
... ... @@ -126,16 +126,29 @@ class ComController extends BaseController
*/
public function edit_info(){
$this->request->validate([
'password'=>['required'],
'name'=>['required'],
],[
'password.required'=>'密码必须填写',
'name.required'=>'名称必须填写',
'oldPassword'=>'required',
'password' => 'required',
'confirm'=>'required',
], [
'oldPassword.required' => '请输入原密码',
'password.required' => '请输入新密码',
'confirm.required' => '请再次输入新密码',
]);
$userLogic = new UserLogic();
$this->param['id'] = $this->uid;
$userLogic->edits();
$this->response('编辑成功');
//查询员密码是否正确
$userModel = new User();
$info = $userModel->read(['id'=>$this->user['id']]);
if($info['password'] != base64_encode(md5($this->param['oldPassword']))){
$this->response('原密码错误',Code::USER_ERROR);
}
if($this->param['password'] != $this->param['confirm']){
$this->response('两次密码不一致');
}
$rs = $userModel->edit(['password'=>base64_encode(md5($this->param['password']))],['id'=>$this->user['id']]);
if($rs === false){
$this->response('系统错误',Code::SYSTEM_ERROR);
}
Cache::pull($info['token']);
$this->response('success',Code::USER_LOGIN_ERROE);
}
/**
... ...
... ... @@ -43,9 +43,9 @@ class UserLoginLogic
$this->fail('当前用户不存在或者被禁用',Code::USER_REGISTER_ERROE);
}
//查看当前账号下有几个项目
if($this->param['password'] == '123456' && $this->param['mobile'] != '15680871314'){
$this->fail('请使用短信登录,修改初始密码');
}
// if($this->param['password'] == '123456' && $this->param['mobile'] != '15680871314'){
// $this->fail('请使用短信登录,修改初始密码');
// }
$password = base64_encode(md5($this->param['password']));
$list = $this->model->list(['mobile'=>$this->param['mobile'],
'password'=>$password,'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']);
... ...