update app/BaseController.php.

增加_ajax=1,_pajax=1伪装功能。

Signed-off-by: liveup <kingf_c@foxmail.com>
This commit is contained in:
liveup
2022-09-04 01:29:50 +00:00
committed by Gitee
parent f6aee95cfc
commit a4c03a454e

View File

@@ -235,7 +235,8 @@ class BaseController
*/
protected function getResponseType(): string
{
return request()->isAjax() || request()->acceptJson() ? 'json' : 'html';
$mask=request()->input('_ajax')==1 ||request()->input('_pjax')==1;
return request()->isAjax() || request()->acceptJson() || $mask ? 'json' : 'html';
}
/**