修复菜单问题

This commit is contained in:
2026-01-26 15:06:56 +08:00
parent 1a7303cedf
commit 3a7a330b7c
3 changed files with 25 additions and 80 deletions
+2 -7
View File
@@ -174,16 +174,11 @@ abstract class BaseController
return (array)$tokenData['user'];
}
private function verifyTokenFromHeader($token): ?array
protected function verifyTokenFromHeader($token): ?array
{
$authHeader = $this->request->header('Authorization', '');
if (!preg_match('/Bearer\s+(.+)/i', $authHeader, $matches)) {
return null;
}
try {
$decoded = \Firebase\JWT\JWT::decode(
$matches[1],
$token,
new \Firebase\JWT\Key(\app\service\JwtService::getSecret(), 'HS256')
);
return (array)$decoded;