request->getAttribute('auth_user'); if ($user instanceof User) { return $user; } // 兜底:直接通过 JWT guard 获取 try { $auth = $this->container->get(AuthManager::class); $user = $auth->guard('jwt')->user(); return $user instanceof User ? $user : null; } catch (\Throwable) { return null; } } }