新增后台

This commit is contained in:
mzl@hnxinyouhe.com
2025-08-12 15:26:17 +08:00
parent 20239dfb6f
commit 360aeec0e1
11 changed files with 372 additions and 167 deletions
+10
View File
@@ -2,9 +2,11 @@
namespace app\admin\service;
use app\common\logic\RoleLogic;
use app\common\validate\RoleValidate;
use app\common\traits\crud\CrudServiceTrait;
use app\common\model\Role;
use support\Db;
class RoleService
{
@@ -28,4 +30,12 @@ class RoleService
{
return new $this->validator;
}
/**
* 获取角色资源
*/
public function menuResource($request, $data)
{
return (new RoleLogic)->updateRoleResources($data);
}
}
+25
View File
@@ -2,6 +2,7 @@
namespace app\admin\service;
use app\admin\logic\UserLogic;
use app\admin\validate\UserValidate;
use app\common\traits\crud\CrudServiceTrait;
use app\common\model\User;
@@ -75,4 +76,28 @@ class UserService
return $config;
}
/**
* 授权
*
* @param Request $request
* @param array $data
* @return bool
*/
public function authorize(Request $request, array $data = [])
{
return (new UserLogic())->updateRoleAndSystem($data);
}
/**
* 更新用户资源权限
*
* @param Request $request
* @param array $data
* @return bool
*/
public function updateResources(Request $request, array $data = [])
{
return (new UserLogic())->updateUserResources($data);
}
}