初始化

main
gzydong 2020-12-09 23:41:31 +08:00
parent 50d6789312
commit d2a2863359
1 changed files with 2 additions and 2 deletions

View File

@ -48,16 +48,16 @@ class JWTAuthMiddleware implements MiddlewareInterface
$token = $request->getHeaderLine('Authorization');
if (empty($token)) {
$token = $this->request->input('token', '');
} else {
$token = JWTUtil::handleToken($token);
}
if (!empty($token)) {
try {
$token = JWTUtil::handleToken($token);
if ($token !== false && $this->jwt->checkToken($token)) {
$isValidToken = true;
}
} catch (\Exception $e) {
$isValidToken = false;
}
}