作者 lyh

gx

... ... @@ -6,6 +6,7 @@ use App\Enums\Common\Common;
use App\Models\Manage\Manage;
use App\Models\Manage\LoginLog;
use App\Models\Service\Service;
use App\Utils\EncryptUtils;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Hash;
... ... @@ -21,7 +22,7 @@ class LoginLogic extends BaseLogic
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new Manage();
}
... ... @@ -84,7 +85,14 @@ class LoginLogic extends BaseLogic
if($info === false){
$this->fail('当前地址不存在或者已被删除');
}
return $this->success($info);
$encrypt = new EncryptUtils();
$data = [
'domain'=>$info['values'],
'autologin_code' => $encrypt->authcode(json_encode(['project_id' => $this->param['project_id']]), 'ENCODE', 'autologin', 3600),
'remark'=>'自动登录地址和code',
];
//获取当前超级管理员的token
return $this->success($data);
}
}
... ...
... ... @@ -78,6 +78,13 @@ class ProjectLogic extends BaseLogic
return $list;
}
/**
* @remark :自动登录加密
* @name :getAutoLoginCode
* @author :lyh
* @method :post
* @time :2023/8/7 9:47
*/
public function getAutoLoginCode($project_id){
$encrypt = new EncryptUtils();
return $encrypt->authcode(json_encode(['project_id' => $project_id]), 'ENCODE', 'autologin', 3600);
... ...
... ... @@ -71,7 +71,6 @@ class UserLoginLogic
$this->fail('该项目未找到注册账号');
}
$info = $this->verifyRole($has_user->toArray());
if(!Cache::get($info['token'])){
//生成新token
$token = md5(uniqid().$info['id']);
... ...