mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
优化json不转义中文
修正transform加载路径
This commit is contained in:
@@ -13,7 +13,7 @@ namespace think\transform\driver;
|
|||||||
|
|
||||||
class Json{
|
class Json{
|
||||||
public function encode($data){
|
public function encode($data){
|
||||||
return json_encode($data);
|
return json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function decode($data, $assoc = true){
|
public function decode($data, $assoc = true){
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace think;
|
namespace think;
|
||||||
use think\View;
|
use think\View;
|
||||||
use think\Transform;
|
use org\Transform;
|
||||||
|
|
||||||
class Controller {
|
class Controller {
|
||||||
// 视图类实例
|
// 视图类实例
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ abstract class Rest {
|
|||||||
if(empty($data)) return '';
|
if(empty($data)) return '';
|
||||||
if('json' == $type) {
|
if('json' == $type) {
|
||||||
// 返回JSON数据格式到客户端 包含状态信息
|
// 返回JSON数据格式到客户端 包含状态信息
|
||||||
$data = json_encode($data);
|
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||||
}elseif('xml' == $type){
|
}elseif('xml' == $type){
|
||||||
// 返回xml格式数据
|
// 返回xml格式数据
|
||||||
$data = xml_encode($data);
|
$data = xml_encode($data);
|
||||||
|
|||||||
Reference in New Issue
Block a user