feat: 更新 README.md,添加 JwtToken.php 中缺失的授权信息异常处理说明
This commit is contained in:
parent
377efca3cb
commit
c5b308c1c4
|
@ -48,6 +48,9 @@ JwtToken.php 需要修改成如下
|
||||||
$token1 = request()->header('Authorization');
|
$token1 = request()->header('Authorization');
|
||||||
$token2 =request()->header('Token');
|
$token2 =request()->header('Token');
|
||||||
$authorization_tmp = !empty($token1) ? $token1 : $token2;
|
$authorization_tmp = !empty($token1) ? $token1 : $token2;
|
||||||
|
if(empty($authorization_tmp)){
|
||||||
|
throw new JwtTokenException('请求未携带authorization信息');
|
||||||
|
}
|
||||||
// $authorization='Bearer '.$authorization_tmp;
|
// $authorization='Bearer '.$authorization_tmp;
|
||||||
if (strpos($authorization_tmp,"Bearer ") === false) {
|
if (strpos($authorization_tmp,"Bearer ") === false) {
|
||||||
$authorization= 'Bearer '.$authorization_tmp;
|
$authorization= 'Bearer '.$authorization_tmp;
|
||||||
|
|
Loading…
Reference in New Issue