mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-05 19:41:43 +08:00
fixed 修复因为普通模式请求异常
This commit is contained in:
parent
8380caa03f
commit
3209c11a0f
@ -25,14 +25,15 @@ class ApiAuth {
|
|||||||
$header = config('apiadmin.CROSS_DOMAIN');
|
$header = config('apiadmin.CROSS_DOMAIN');
|
||||||
|
|
||||||
$pathParam = [];
|
$pathParam = [];
|
||||||
$pathArr = explode('/', $request->pathinfo());
|
$pathParamStr = str_replace($request->rule()->getRule() . '/', '', $request->pathinfo());
|
||||||
|
$pathArr = explode('/', $pathParamStr);
|
||||||
$pathArrLen = count($pathArr);
|
$pathArrLen = count($pathArr);
|
||||||
for ($index = 0; $index < $pathArrLen; $index += 2) {
|
for ($index = 0; $index < $pathArrLen; $index += 2) {
|
||||||
if ($index + 1 < $pathArrLen) {
|
if ($index + 1 < $pathArrLen) {
|
||||||
$pathParam[$pathArr[$index]] = $pathArr[$index + 1];
|
$pathParam[$pathArr[$index]] = $pathArr[$index + 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$apiHash = $pathParam['api'];
|
$apiHash = str_replace('api/', '', $request->rule()->getRule());
|
||||||
|
|
||||||
if ($apiHash) {
|
if ($apiHash) {
|
||||||
$cached = Cache::has('ApiInfo:' . $apiHash);
|
$cached = Cache::has('ApiInfo:' . $apiHash);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user