parent.{$funName}({$jsonStr})"; } else { return ""; } } /** * 中文乱码转 utf-8, 对页面中 用 encodeURI(encodeURI(url)) 处理过的 url 有效 * @return */ public static function getRequestDecodeParam($request, $key) { $str = $request[$key]; if ($str != null) { try { //解决%和+转码问题 $str = preg_replace("/%(?![0-9a-fA-F]{2})/", "%25", $str); $str = preg_replace("/\\+/", "%2B", $str); return trim(urldecode($str)); } catch (\Exception $e) { throw new \think\Exception($e->getMessage()); } } else { return $str; } } public static function batchGetRequestDecodeParam($request) { $params = $request->param(); foreach ($params as $key => $param) { $params[$key] = self::getRequestDecodeParam($params, $key); } return $params; } }