We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8380caa commit 3209c11Copy full SHA for 3209c11
app/middleware/ApiAuth.php
@@ -25,14 +25,15 @@ public function handle($request, \Closure $next) {
25
$header = config('apiadmin.CROSS_DOMAIN');
26
27
$pathParam = [];
28
- $pathArr = explode('/', $request->pathinfo());
+ $pathParamStr = str_replace($request->rule()->getRule() . '/', '', $request->pathinfo());
29
+ $pathArr = explode('/', $pathParamStr);
30
$pathArrLen = count($pathArr);
31
for ($index = 0; $index < $pathArrLen; $index += 2) {
32
if ($index + 1 < $pathArrLen) {
33
$pathParam[$pathArr[$index]] = $pathArr[$index + 1];
34
}
35
- $apiHash = $pathParam['api'];
36
+ $apiHash = str_replace('api/', '', $request->rule()->getRule());
37
38
if ($apiHash) {
39
$cached = Cache::has('ApiInfo:' . $apiHash);
0 commit comments