Zhu Jinhui 7 лет назад
Родитель
Сommit
9a61df5296

+ 12 - 0
demo/private/controller/dirs.php

@@ -89,4 +89,16 @@ class dirs extends base
 		$download = new \Qii\Library\Download();
 		$download->download($file);
 	}
+
+	protected function echoJson($data)
+	{
+		echo $this->jsonEncode($data);
+	}
+
+	protected function jsonEncode($data)
+	{
+		if (empty($data)) return '{}';
+		if (isset($data['code']) && $data['code'] > 0 && !isset($data['msg'])) $data['msg'] = _i($data['code']);
+		return json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE);
+	}
 }

+ 1 - 1
demo/private/helper/tools.php

@@ -115,7 +115,7 @@ class tools
 			if ($filter != '*' && !$isDir && !preg_match('/' . $filter . '$/', $file)) continue;
 			$array = array();
 			$type = self::fileType($fullPath);
-			$array['name'] = $file;
+			$array['name'] = iconv('GBK', 'UTF-8', $file);
 			if (!in_array($type, $filetype)) {
 				$array['icon'] = _link('filetype/unknow.png');
 			} else {

+ 1 - 1
demo/private/view/manage/folder/dir.html

@@ -13,7 +13,7 @@
     <script type="text/javascript" src="{#_link("static/js/jquery.multiSelect.js")#}"></script>
     <script type="text/javascript" src="{#_link("static/js/tips.js")#}"></script>
     <script type="text/javascript" src="{#_link("static/js/notify-custom.min.js")#}"></script>
-    <script type="text/javascript" src="{#_link("static/js/static/layer/layer.js")#}"></script>
+    <script type="text/javascript" src="{#_link("static/layer/layer.js")#}"></script>
 </head>
  <body>
   <div class="place">