From 36bf77df6ce5e83db4a997309dc21c0e92af4528 Mon Sep 17 00:00:00 2001 From: Karson Date: Sat, 23 Mar 2024 18:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4API=E5=9F=BA=E7=B1=BB?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=A4=E6=96=ADJSONP=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/common/controller/Api.php b/application/common/controller/Api.php index bdbd815f..f685ca20 100644 --- a/application/common/controller/Api.php +++ b/application/common/controller/Api.php @@ -204,8 +204,8 @@ class Api 'time' => Request::instance()->server('REQUEST_TIME'), 'data' => $data, ]; - // 如果未设置类型则自动判断 - $type = $type ? $type : ($this->request->param(config('var_jsonp_handler')) ? 'jsonp' : $this->responseType); + // 如果未设置类型则使用默认类型判断 + $type = $type ? : $this->responseType; if (isset($header['statuscode'])) { $code = $header['statuscode'];