diff --git a/application/index/controller/File.php b/application/index/controller/File.php index 1ff41fbd..0860c583 100644 --- a/application/index/controller/File.php +++ b/application/index/controller/File.php @@ -64,7 +64,7 @@ class File extends Controller{ } public function Preview(){ - $reqPath = $_GET["path"]; + $reqPath =$_GET["path"]; $fileObj = new FileManage($reqPath,$this->userObj->uid); $Redirect = $fileObj->PreviewHandler(); if($Redirect[0]){ @@ -74,7 +74,7 @@ class File extends Controller{ public function ListPic(){ $reqPath = $_GET["path"]; - return FileManage::listPic($reqPath,$this->userObj->uid); + return json(FileManage::listPic($reqPath,$this->userObj->uid)); } public function Download(){ diff --git a/application/index/model/FileManage.php b/application/index/model/FileManage.php index 44d1b0a2..3df9c72f 100644 --- a/application/index/model/FileManage.php +++ b/application/index/model/FileManage.php @@ -622,20 +622,20 @@ class FileManage extends Model{ foreach ($fileList as $key => $value) { if($value["orign_name"] == $firstPreview[0]){ $previewPicInfo = explode(",",$value["pic_info"]); - $previewSrc = $url."action=preview&path=".$path."/".$value["orign_name"]; + $previewSrc = $url."action=preview&path=".urlencode($path."/".$value["orign_name"]); }else{ $picInfo = explode(",",$value["pic_info"]); $fileListData[$count]['src'] = $url."action=preview&path=".$path."/".$value["orign_name"]; - $fileListData[$count]['w'] = $picInfo[0]; - $fileListData[$count]['h'] = $picInfo[1]; + $fileListData[$count]['w'] = 0; + $fileListData[$count]['h'] = 0; $fileListData[$count]['title'] = $value["orign_name"]; $count++; } } array_unshift($fileListData,array( 'src' => $previewSrc, - 'w' => $previewPicInfo[0], - 'h' => $previewPicInfo[1], + 'w' => 0, + 'h' => 0, 'title' => $firstPreview[0], )); return $fileListData; diff --git a/application/index/view/home/home.html b/application/index/view/home/home.html index a5222d7b..2ac8f159 100644 --- a/application/index/view/home/home.html +++ b/application/index/view/home/home.html @@ -33,7 +33,8 @@ allowTorrentDownload:"{:explode(",",$groupData.aria2)[1]}", }; apiURL={ - imgThumb:"/File/Thumb" + imgThumb:"/File/Thumb", + preview:"/File/Preview", }; mediaType = {} @@ -55,5 +56,5 @@ To create a production bundle, use `npm run build` or `yarn build`. --> - +