feat: 更新 README.md,添加 JwtToken.php 中缺失的授权信息异常处理说明

This commit is contained in:
lingling 2025-03-16 12:47:30 +08:00
parent 377efca3cb
commit c5b308c1c4
1 changed files with 4 additions and 1 deletions

View File

@ -48,6 +48,9 @@ JwtToken.php 需要修改成如下
$token1 = request()->header('Authorization');
$token2 =request()->header('Token');
$authorization_tmp = !empty($token1) ? $token1 : $token2;
if(empty($authorization_tmp)){
throw new JwtTokenException('请求未携带authorization信息');
}
// $authorization='Bearer '.$authorization_tmp;
if (strpos($authorization_tmp,"Bearer ") === false) {
$authorization= 'Bearer '.$authorization_tmp;