fixed 修复因为普通模式请求异常

This commit is contained in:
zhaoxiang 2021-10-28 15:54:09 +08:00
parent 8380caa03f
commit 3209c11a0f

View File

@ -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);