fix : jwt

This commit is contained in:
2025-09-12 23:54:03 +08:00
parent ea6abe3043
commit 68ecac2fb9
8 changed files with 121 additions and 42 deletions

View File

@@ -31,7 +31,11 @@ class JwtExceptionHandler extends BaseErrExceptionHandler
return $response;
}
protected function modifyException(JWTException $e): Throwable
/**
* @param JWTException $e
* @return ErrException
*/
protected function modifyException(JWTException $e): ErrException
{
// 根据不同的异常类型设置不同的code和message
switch ($e->getMessage()) {
@@ -51,7 +55,7 @@ class JwtExceptionHandler extends BaseErrExceptionHandler
$e->setCustomMessage($message);
}
return $e;
return New ErrException($message,$code);
}
/**