From df597fd4f08f87124f7b10112c8b6c91feceabe8 Mon Sep 17 00:00:00 2001 From: "X.Mo" Date: Thu, 13 Apr 2023 11:29:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DAuth=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E5=8F=AA=E8=8E=B7=E5=8F=96method=E5=8F=82=E6=95=B0=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=8E=B7=E5=8F=96class=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mine/Aspect/AuthAspect.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mine/Aspect/AuthAspect.php b/mine/Aspect/AuthAspect.php index 99e1a60e..213793e1 100644 --- a/mine/Aspect/AuthAspect.php +++ b/mine/Aspect/AuthAspect.php @@ -40,17 +40,19 @@ class AuthAspect extends AbstractAspect */ public function process(ProceedingJoinPoint $proceedingJoinPoint) { + $scene = 'default'; + /** @var $auth Auth */ if (isset($proceedingJoinPoint->getAnnotationMetadata()->class[Auth::class])) { $auth = $proceedingJoinPoint->getAnnotationMetadata()->class[Auth::class]; + $scene = $auth->scene ?? 'default'; } if (isset($proceedingJoinPoint->getAnnotationMetadata()->method[Auth::class])) { $auth = $proceedingJoinPoint->getAnnotationMetadata()->method[Auth::class]; + $scene = $auth->scene ?? 'default'; } - $scene = $auth->scene ?? 'default'; - $loginUser = user($scene); if (! $loginUser->check(null, $scene)) {