|
@@ -5,6 +5,7 @@ namespace app\admin\logic;
|
|
|
use app\model\CommonModel;
|
|
|
use app\model\RoleModel;
|
|
|
use think\Exception;
|
|
|
+use think\exception\ValidateException;
|
|
|
use think\facade\Db;
|
|
|
use think\response\Json;
|
|
|
|
|
@@ -94,6 +95,15 @@ class RoleLogic extends BaseLogic
|
|
|
->where(['id' => $id, 'is_del' => CommonModel::$del_normal])
|
|
|
->findOrEmpty()
|
|
|
->toArray();
|
|
|
+
|
|
|
+ if (empty($rs)) throw new ValidateException('该角色详情为空');
|
|
|
+
|
|
|
+ //已有的权限信息
|
|
|
+ $rs['action'] = Db::name('role_action')
|
|
|
+ ->where(['roleid' => $id, 'is_del' => CommonModel::$del_normal, 'status' => CommonModel::$status_normal])
|
|
|
+ ->value('action_data');
|
|
|
+ $rs['action'] = explode(',', $rs['action']);
|
|
|
+
|
|
|
return json_show(CommonModel::$success, '获取角色详情成功', $rs);
|
|
|
|
|
|
}
|