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