mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-24 10:20:16 +08:00
modified 禁止管理员被禁用
This commit is contained in:
parent
1ad68affed
commit
88040572b9
@ -145,6 +145,7 @@ class User extends Base {
|
|||||||
public function close(){
|
public function close(){
|
||||||
if( $this->request->isPut() ){
|
if( $this->request->isPut() ){
|
||||||
$id = $this->request->put($this->primaryKey);
|
$id = $this->request->put($this->primaryKey);
|
||||||
|
if(!isAdministrator($id)){
|
||||||
$userObj = \app\admin\model\User::get([$this->primaryKey => $id]);
|
$userObj = \app\admin\model\User::get([$this->primaryKey => $id]);
|
||||||
if( is_null($userObj) ){
|
if( is_null($userObj) ){
|
||||||
$this->error('用户不存在','');
|
$this->error('用户不存在','');
|
||||||
@ -153,6 +154,9 @@ class User extends Base {
|
|||||||
$userObj->save();
|
$userObj->save();
|
||||||
$this->success('操作成功', url('User/index'));
|
$this->success('操作成功', url('User/index'));
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$this->error('管理员不能被禁用','');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user