qbhy / laravel-api-auth

可以自定义的 laravel API 鉴权包。
55 stars 15 forks source link

报Undefined offset: 0错误 #4

Open sunding0308 opened 6 years ago

sunding0308 commented 6 years ago

/vendor/96qbhy/laravel-api-auth/src/Middleware.php:41 list($header, $payload, $alg) = $this->parseParams($header_string, $payload_string); 这里的返回值是个数组,并且数组的索引是 return compact('header', 'payload', 'alg');。 但是list()函数仅能用于数字索引的数组,并假定数字索引从 0 开始。 我将此行代码改为 list($header, $payload, $alg) = array_values($this->parseParams($header_string, $payload_string)); 就没问题了。不知是否正确,请解答。

daisanmu commented 6 years ago

赶紧把这个加上把。。。。还有人在吗

sunding0308 commented 6 years ago

@daisanmu https://github.com/sunding0308/laravel-api-auth.git

ixyt commented 5 years ago

不光是这个问题吧,api-token的过期时间貌似都没用上,可以加上过期时间校验的吧?????