正在显示
4 个修改的文件
包含
18 行增加
和
2 行删除
| @@ -9,6 +9,7 @@ use App\Models\Channel\Channel; | @@ -9,6 +9,7 @@ use App\Models\Channel\Channel; | ||
| 9 | use App\Models\Com\NoticeLog; | 9 | use App\Models\Com\NoticeLog; |
| 10 | use App\Models\Com\UpdateLog; | 10 | use App\Models\Com\UpdateLog; |
| 11 | use App\Models\Com\UpdateVisit; | 11 | use App\Models\Com\UpdateVisit; |
| 12 | +use App\Models\Manage\Mobile; | ||
| 12 | use App\Models\Project\After; | 13 | use App\Models\Project\After; |
| 13 | use App\Models\Project\DeployBuild; | 14 | use App\Models\Project\DeployBuild; |
| 14 | use App\Models\Project\DeployOptimize; | 15 | use App\Models\Project\DeployOptimize; |
| @@ -456,6 +457,10 @@ class SyncProject extends Command | @@ -456,6 +457,10 @@ class SyncProject extends Command | ||
| 456 | */ | 457 | */ |
| 457 | public function createUser($mobile,$project_id,$lead_name){ | 458 | public function createUser($mobile,$project_id,$lead_name){ |
| 458 | $userModel = new UserModel(); | 459 | $userModel = new UserModel(); |
| 460 | + //查看当前项目是否存在号码库中 | ||
| 461 | + $mobileModel = new Mobile(); | ||
| 462 | + $mobileInfo = $mobileModel->read(['mobile'=>$mobile]); | ||
| 463 | + if($mobileInfo === false){ | ||
| 459 | //查看当前用户是否存在 | 464 | //查看当前用户是否存在 |
| 460 | $info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]); | 465 | $info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]); |
| 461 | if($info === false){ | 466 | if($info === false){ |
| @@ -469,4 +474,6 @@ class SyncProject extends Command | @@ -469,4 +474,6 @@ class SyncProject extends Command | ||
| 469 | $userModel->add($data); | 474 | $userModel->add($data); |
| 470 | } | 475 | } |
| 471 | } | 476 | } |
| 477 | + return true; | ||
| 478 | + } | ||
| 472 | } | 479 | } |
| @@ -8,9 +8,8 @@ use App\Utils\LogUtils; | @@ -8,9 +8,8 @@ use App\Utils\LogUtils; | ||
| 8 | use GuzzleHttp\Client; | 8 | use GuzzleHttp\Client; |
| 9 | use GuzzleHttp\Exception\GuzzleException; | 9 | use GuzzleHttp\Exception\GuzzleException; |
| 10 | use Illuminate\Support\Carbon; | 10 | use Illuminate\Support\Carbon; |
| 11 | -use App\Models\File\File; | ||
| 12 | -use Illuminate\Support\Facades\Cache; | ||
| 13 | use Illuminate\Support\Facades\Redis; | 11 | use Illuminate\Support\Facades\Redis; |
| 12 | +use App\Models\User\User; | ||
| 14 | 13 | ||
| 15 | define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/'); | 14 | define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/'); |
| 16 | /** | 15 | /** |
| @@ -134,6 +134,12 @@ class LoginLogic extends BaseLogic | @@ -134,6 +134,12 @@ class LoginLogic extends BaseLogic | ||
| 134 | } | 134 | } |
| 135 | //获取超级管理员登录 | 135 | //获取超级管理员登录 |
| 136 | if(isset($this->param['project_id']) && !empty($this->param['project_id'])){ | 136 | if(isset($this->param['project_id']) && !empty($this->param['project_id'])){ |
| 137 | + //查看当前项目是否有超级管理员 | ||
| 138 | + $userModel = new User(); | ||
| 139 | + $userinfo = $userModel->read(['project_id'=>$this->param['project_id'],'role_id'=>0]); | ||
| 140 | + if($userinfo === false){ | ||
| 141 | + $this->fail('未添加超级管理员账号,请添加后在进入账号;'); | ||
| 142 | + } | ||
| 137 | $data['autologin_code'] = $encrypt->lock_url(json_encode(['project_id'=>$this->param['project_id'],'manager_id'=>$this->manager['id']]),$info['values']); | 143 | $data['autologin_code'] = $encrypt->lock_url(json_encode(['project_id'=>$this->param['project_id'],'manager_id'=>$this->manager['id']]),$info['values']); |
| 138 | } | 144 | } |
| 139 | //使用用户登录 | 145 | //使用用户登录 |
| @@ -6,6 +6,7 @@ use App\Helper\Common; | @@ -6,6 +6,7 @@ use App\Helper\Common; | ||
| 6 | use App\Http\Logic\Aside\BaseLogic; | 6 | use App\Http\Logic\Aside\BaseLogic; |
| 7 | use App\Models\Manage\Manage; | 7 | use App\Models\Manage\Manage; |
| 8 | use App\Models\Manage\MenuSpecial; | 8 | use App\Models\Manage\MenuSpecial; |
| 9 | +use App\Models\Manage\Mobile; | ||
| 9 | use App\Models\Project\Project; | 10 | use App\Models\Project\Project; |
| 10 | use App\Models\User\ProjectRole; | 11 | use App\Models\User\ProjectRole; |
| 11 | use App\Models\User\User; | 12 | use App\Models\User\User; |
| @@ -54,6 +55,9 @@ class UserLogic extends BaseLogic | @@ -54,6 +55,9 @@ class UserLogic extends BaseLogic | ||
| 54 | $this->param = $this->editPassword($this->param); | 55 | $this->param = $this->editPassword($this->param); |
| 55 | $rs = $this->model->edit($this->param, ['id' => $this->param['id']]); | 56 | $rs = $this->model->edit($this->param, ['id' => $this->param['id']]); |
| 56 | } else { | 57 | } else { |
| 58 | + $mobileModel = new Mobile(); | ||
| 59 | + //查看当前手机号码是否存在于手机号码库 | ||
| 60 | + $mobileInfo = $mobileModel->read(['mobile'=>$this->param['mobile']]); | ||
| 57 | $this->param['password'] = base64_encode(md5($this->param['password'])); | 61 | $this->param['password'] = base64_encode(md5($this->param['password'])); |
| 58 | $rs = $this->model->add($this->param); | 62 | $rs = $this->model->add($this->param); |
| 59 | } | 63 | } |
-
请 注册 或 登录 后发表评论