作者 lyh

gx

... ... @@ -9,6 +9,7 @@ use App\Models\Channel\Channel;
use App\Models\Com\NoticeLog;
use App\Models\Com\UpdateLog;
use App\Models\Com\UpdateVisit;
use App\Models\Manage\Mobile;
use App\Models\Project\After;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
... ... @@ -456,6 +457,10 @@ class SyncProject extends Command
*/
public function createUser($mobile,$project_id,$lead_name){
$userModel = new UserModel();
//查看当前项目是否存在号码库中
$mobileModel = new Mobile();
$mobileInfo = $mobileModel->read(['mobile'=>$mobile]);
if($mobileInfo === false){
//查看当前用户是否存在
$info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]);
if($info === false){
... ... @@ -469,4 +474,6 @@ class SyncProject extends Command
$userModel->add($data);
}
}
return true;
}
}
... ...
... ... @@ -8,9 +8,8 @@ use App\Utils\LogUtils;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Carbon;
use App\Models\File\File;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;
use App\Models\User\User;
define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/');
/**
... ...
... ... @@ -134,6 +134,12 @@ class LoginLogic extends BaseLogic
}
//获取超级管理员登录
if(isset($this->param['project_id']) && !empty($this->param['project_id'])){
//查看当前项目是否有超级管理员
$userModel = new User();
$userinfo = $userModel->read(['project_id'=>$this->param['project_id'],'role_id'=>0]);
if($userinfo === false){
$this->fail('未添加超级管理员账号,请添加后在进入账号;');
}
$data['autologin_code'] = $encrypt->lock_url(json_encode(['project_id'=>$this->param['project_id'],'manager_id'=>$this->manager['id']]),$info['values']);
}
//使用用户登录
... ...
... ... @@ -6,6 +6,7 @@ use App\Helper\Common;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Manage\Manage;
use App\Models\Manage\MenuSpecial;
use App\Models\Manage\Mobile;
use App\Models\Project\Project;
use App\Models\User\ProjectRole;
use App\Models\User\User;
... ... @@ -54,6 +55,9 @@ class UserLogic extends BaseLogic
$this->param = $this->editPassword($this->param);
$rs = $this->model->edit($this->param, ['id' => $this->param['id']]);
} else {
$mobileModel = new Mobile();
//查看当前手机号码是否存在于手机号码库
$mobileInfo = $mobileModel->read(['mobile'=>$this->param['mobile']]);
$this->param['password'] = base64_encode(md5($this->param['password']));
$rs = $this->model->add($this->param);
}
... ...