|
...
|
...
|
@@ -42,6 +42,9 @@ class UserLogic extends BaseLogic |
|
|
|
if($info !== false){
|
|
|
|
$this->fail('当前手机号码已注册');
|
|
|
|
}
|
|
|
|
if(!isset($this->param['role']) || empty($this->param['role'])){
|
|
|
|
$this->fail('一个账号只允许一个超级管理员,请先添加角色');
|
|
|
|
}
|
|
|
|
$this->param['create_id'] = $this->user['id'];
|
|
|
|
$this->param['operator_id'] = $this->user['id'];
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
...
|
...
|
@@ -74,7 +77,13 @@ class UserLogic extends BaseLogic |
|
|
|
}
|
|
|
|
$this->param['type'] = 1;
|
|
|
|
$this->param['operator_id'] = $this->user['id'];
|
|
|
|
$this->edits();
|
|
|
|
if(isset($this->param['password']) && empty($this->param['password'])){
|
|
|
|
$this->param['password'] = base64_encode(md5($this->param['password']));
|
|
|
|
}
|
|
|
|
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -107,33 +116,4 @@ class UserLogic extends BaseLogic |
|
|
|
//对应删除组织架构
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $param
|
|
|
|
* @remark :编辑用户
|
|
|
|
* @name :edits
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/17 16:41
|
|
|
|
*/
|
|
|
|
public function edits(){
|
|
|
|
if(!isset($this->param['password']) || empty($this->param['password'])){
|
|
|
|
unset($this->param['password']);
|
|
|
|
}else{
|
|
|
|
$this->param['password'] = base64_encode(md5($this->param['password']));
|
|
|
|
}
|
|
|
|
$info = $this->model->read(['mobile'=>$this->param['mobile'],
|
|
|
|
'project_id'=>$this->user['project_id'],'id'=>['!=',$this->param['id']]]);
|
|
|
|
if($info !== false){
|
|
|
|
$this->fail('当前手机号码已注册');
|
|
|
|
}
|
|
|
|
//密码加密
|
|
|
|
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
//清空当前用户登录缓存
|
|
|
|
Cache::pull($this->user['token']);
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|