禁止用户修改自己角色
This commit is contained in:
1 parent
bdff20858e
commit
30f348c633
11 files changed
+60
-39
No files matched your search
@@ -126,7 +126,7 @@ class AuthGroupAccess extends BaseController
|
||||
$id = request()->delete('id');
|
||||
$id = explode(',', $id);
|
||||
|
||||
$data = AGA::destroy($id);
|
||||
$data = AGA::destroy($id,true);
|
||||
|
||||
// 根据更新结果设置返回提示信息
|
||||
$data ? $data = ['msg' => '删除成功', 'val' => 1]
|
||||
|
||||
+11
-11
@@ -71,11 +71,11 @@ class Admin extends BaseModel
|
||||
}
|
||||
|
||||
|
||||
// 用户角色获取器
|
||||
public function userGroup()
|
||||
{
|
||||
return $this->belongsToMany('AuthGroup', 'AuthGroupAccess', 'id', 'uid');
|
||||
}
|
||||
// // 用户角色获取器
|
||||
// public function userGroup()
|
||||
// {
|
||||
// return $this->belongsToMany('AuthGroup', 'AuthGroupAccess', 'id', 'uid');
|
||||
// }
|
||||
|
||||
|
||||
// 获取密码
|
||||
@@ -139,12 +139,12 @@ class Admin extends BaseModel
|
||||
}
|
||||
|
||||
|
||||
// 角色关联
|
||||
public function authGroup()
|
||||
{
|
||||
return $this->hasMany('AuthGroupAccess', 'uid', 'id')
|
||||
->field('id, uid, group_id');
|
||||
}
|
||||
// // 角色关联
|
||||
// public function authGroup()
|
||||
// {
|
||||
// return $this->hasMany('AuthGroupAccess', 'uid', 'id')
|
||||
// ->field('id, uid, group_id');
|
||||
// }
|
||||
|
||||
|
||||
// 获取角色名称
|
||||
|
||||
@@ -41,6 +41,7 @@ class AuthGroupAccess extends BaseModel
|
||||
});
|
||||
|
||||
})
|
||||
->where('uid','<>', session('userid'))
|
||||
->with([
|
||||
'jsUser' => function($query) use($src) {
|
||||
$query->field('id,xingming,school_id,username')
|
||||
|
||||
Loaded 3 of 11 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user