refactor:取消响应类型自动判断至 jsonp,因为跨域请求均会被中间件拦截

This commit is contained in:
妙码生花 2024-10-15 09:06:06 +08:00
parent 29faf6189c
commit 1573df7e91

View File

@ -114,8 +114,7 @@ class Api extends BaseController
'data' => $data, 'data' => $data,
]; ];
// 如果未设置类型则自动判断 $type = $type ?: $this->responseType;
$type = $type ?: ($this->request->param(Config::get('route.var_jsonp_handler')) ? 'jsonp' : $this->responseType);
$code = 200; $code = 200;
if (isset($header['statuscode'])) { if (isset($header['statuscode'])) {