feat : kitchen

This commit is contained in:
2024-11-08 16:27:25 +08:00
parent 79782dbb4e
commit c491fb79d8
15 changed files with 727 additions and 25 deletions

View File

@@ -44,7 +44,7 @@ class AdminLoginLogAspect extends AbstractAspect
return $result;
} catch (AdminException $e) {
var_dump($e->getMessage());
// var_dump($e->getMessage());
throw new AdminException($e->getMessage());
}
}

View File

@@ -23,8 +23,7 @@ class AdminOperationAspect extends AbstractAspect
public array $classes = [
'App\\Service\\Admin\\User\\*Service',
'App\\Service\\Admin\\Third\\*Service',
'App\Service\Admin\System\CityService',
'App\Service\Admin\System\ConfigService',
'App\\Service\\Admin\\System\\*Service',
];
/**
@@ -47,7 +46,7 @@ class AdminOperationAspect extends AbstractAspect
public function process(ProceedingJoinPoint $proceedingJoinPoint): mixed
{
// 鉴权
$this->checkAuthentication();
// $this->checkAuthentication();
// 写操作日志
$this->writeOperationLog();
@@ -56,24 +55,24 @@ class AdminOperationAspect extends AbstractAspect
return $proceedingJoinPoint->process();
}
/**
* @return void
*/
private function checkAuthentication(): void
{
$adminId = Context::get('admin_id');
$roleId = Context::get('role_id');
//如果没有id 说明没有登录 抛出异常
if (empty($adminId) || empty($roleId)) {
throw new AdminException('请先登录');
}
//超级管理员不需要鉴权
if ($roleId == 1) return;
//todo 其他角色需要鉴权
}
// /**
// * @return void
// */
// private function checkAuthentication(): void
// {
// $adminId = Context::get('admin_id');
// $roleId = Context::get('role_id');
//
// //如果没有id 说明没有登录 抛出异常
// if (empty($adminId) || empty($roleId)) {
// throw new AdminException('请先登录');
// }
//
// //超级管理员不需要鉴权
// if ($roleId == 1) return;
//
// //其他角色需要鉴权
// }
/**
* 写入请求日志