added 密钥对的删除

This commit is contained in:
zhaoxiang 2016-11-30 01:05:32 +08:00
parent 963b3be974
commit 2470bcc176

View File

@ -196,15 +196,9 @@ class KeyManager extends Base {
public function del(){ public function del(){
if( $this->request->isDelete() ){ if( $this->request->isDelete() ){
$key = $this->request->delete($this->primaryKey); $key = $this->request->delete($this->primaryKey);
if(!isAdministrator($key)){ $delNum = Keys::destroy($key);
$delNum = \app\admin\model\User::destroy($key);
if( $delNum ){ if( $delNum ){
UserData::destroy(['uid' => $key]); $this->success('操作成功!', url('KeyManager/index'));
AuthGroupAccess::destroy(['uid' => $key]);
$this->success('操作成功!', url('User/index'));
}
}else{
$this->error('管理员不能被删除!');
} }
} }
$this->error('操作失败!'); $this->error('操作失败!');