|
|
@@ -13,6 +13,7 @@ namespace App\Services\Common;
|
|
|
|
|
|
|
|
|
use App\Models\MenuModel;
|
|
|
+use App\Models\UserRoleModel;
|
|
|
use App\Services\BaseService;
|
|
|
use App\Services\RedisService;
|
|
|
|
|
|
@@ -217,12 +218,18 @@ class MenuService extends BaseService
|
|
|
public function getPermissionList($userId)
|
|
|
{
|
|
|
$list = [];
|
|
|
+
|
|
|
if ($userId == 1) {
|
|
|
// 管理员拥有全部权限
|
|
|
$list = $this->model->getChilds(0);
|
|
|
} else {
|
|
|
- // 其他角色
|
|
|
- $list = $this->getPermissionMenu($userId, 0);
|
|
|
+ $isSupper = UserRoleModel::where(['user_id'=>$userId,'role_id'=>1])->first();
|
|
|
+ if($isSupper){
|
|
|
+ $list = $this->model->getChilds(0);
|
|
|
+ }else{
|
|
|
+ // 其他角色
|
|
|
+ $list = $this->getPermissionMenu($userId, 0);
|
|
|
+ }
|
|
|
}
|
|
|
return message("操作成功", true, $list);
|
|
|
}
|