Feat: Folder share

pull/141/head
HFO4 7 years ago
parent d84b00f35d
commit 41d1294ebf

@ -35,9 +35,10 @@ class Share extends Controller{
'dirData' => $shareObj->dirData, 'dirData' => $shareObj->dirData,
'shareData' => $shareObj->shareData, 'shareData' => $shareObj->shareData,
'loginStatus' => $this->userObj->loginStatus, 'loginStatus' => $this->userObj->loginStatus,
'userData' => $this->userObj->userSQLData, 'userData' => $this->userObj->getInfo(),
'groupData' => $shareObj->shareOwner->groupData, 'groupData' => $shareObj->shareOwner->groupData,
'allowPreview' => Option::getValue("allowdVisitorDownload"), 'allowPreview' => Option::getValue("allowdVisitorDownload"),
'path' => empty(input("get.path"))?"/":input("get.path"),
]); ]);
}else{ }else{
return view('share_single', [ return view('share_single', [
@ -85,6 +86,20 @@ class Share extends Controller{
} }
} }
public function Content(){
$shareId = input('param.key');
$filePath = input('get.path');
$shareObj = new ShareHandler($shareId,false);
if(empty($filePath)){
//todo 单文件时
}else{
$contentHandller = $shareObj->getContent($this->userObj,$filePath);
}
if(!$contentHandller[0]){
return json(["result"=>["success"=>false,"error"=>$contentHandller[1]]]);
}
}
public function chekPwd(){ public function chekPwd(){
$shareId = input('key'); $shareId = input('key');
$inputPwd = input('password'); $inputPwd = input('password');
@ -122,7 +137,7 @@ class Share extends Controller{
$shareId = input('param.key'); $shareId = input('param.key');
$reqPathTo = stripslashes(json_decode(file_get_contents("php://input"),true)['path']); $reqPathTo = stripslashes(json_decode(file_get_contents("php://input"),true)['path']);
$shareObj = new ShareHandler($shareId,false); $shareObj = new ShareHandler($shareId,false);
return $shareObj->ListFile($reqPathTo); return json($shareObj->ListFile($reqPathTo));
} }
public function ListPic(){ public function ListPic(){
@ -133,8 +148,8 @@ class Share extends Controller{
} }
public function Thumb(){ public function Thumb(){
$shareId = input('get.shareKey'); $shareId = input('param.key');
$filePath = input('get.path'); $filePath = urldecode(input('get.path'));
if(input("get.isImg") != "true"){ if(input("get.isImg") != "true"){
return ""; return "";
} }
@ -147,6 +162,23 @@ class Share extends Controller{
} }
} }
public function DocPreview(){
$shareId = input('param.key');
$filePath = urldecode(input('get.path'));
$shareObj = new ShareHandler($shareId,false);
if(empty($filePath)){
//TODO 单文件时
}else{
$Redirect = $shareObj->getDocPreview($this->userObj,$filePath);
}
if($Redirect[0]){
$this->redirect($Redirect[1],302);
}else{
$this->error($Redirect[1],403,$this->siteOptions);
}
}
public function Delete(){ public function Delete(){
$shareId = input('post.id'); $shareId = input('post.id');
$shareObj = new ShareHandler($shareId,false); $shareObj = new ShareHandler($shareId,false);

@ -7,6 +7,7 @@ use \app\index\model\Option;
use \app\index\model\User; use \app\index\model\User;
use think\Session; use think\Session;
use \app\index\model\FileManage; use \app\index\model\FileManage;
use \app\index\model\ShareHandler;
class Viewer extends Controller{ class Viewer extends Controller{
@ -26,12 +27,17 @@ class Viewer extends Controller{
$pathSplit = explode("/",urldecode($path)); $pathSplit = explode("/",urldecode($path));
$userInfo = $this->userObj->getInfo(); $userInfo = $this->userObj->getInfo();
$groupData = $this->userObj->getGroupData(); $groupData = $this->userObj->getGroupData();
$url = "/File/Preview?action=preview&path=".$path;
if(input("get.share")==true){
$url = "/Share/Preview/".input("get.shareKey")."/?path=".$path;
}
return view('video', [ return view('video', [
'options' => Option::getValues(['basic']), 'options' => Option::getValues(['basic']),
'userInfo' => $userInfo, 'userInfo' => $userInfo,
'groupData' => $groupData, 'groupData' => $groupData,
'url' => "/File/Preview?action=preview&path=".$path, 'url' => $url,
'fileName' => end($pathSplit), 'fileName' => end($pathSplit),
'isSharePage' => input("?get.share")?"true":"false",
]); ]);
} }
@ -40,13 +46,18 @@ class Viewer extends Controller{
$pathSplit = explode("/",urldecode($path)); $pathSplit = explode("/",urldecode($path));
$userInfo = $this->userObj->getInfo(); $userInfo = $this->userObj->getInfo();
$groupData = $this->userObj->getGroupData(); $groupData = $this->userObj->getGroupData();
$url = "/File/Content?action=preview&path=".$path;
if(input("get.share")==true){
$url = "/Share/Content/".input("get.shareKey")."/?path=".$path;
}
return view('markdown', [ return view('markdown', [
'options' => Option::getValues(['basic']), 'options' => Option::getValues(['basic']),
'userInfo' => $userInfo, 'userInfo' => $userInfo,
'groupData' => $groupData, 'groupData' => $groupData,
'url' => "/File/Content?action=preview&path=".$path, 'url' => $url,
'fileName' => end($pathSplit), 'fileName' => end($pathSplit),
'path' => urldecode($path), 'path' => urldecode($path),
'isSharePage' => input("?get.share")?"true":"false",
]); ]);
} }

@ -636,11 +636,14 @@ class FileManage extends Model{
} }
/** /**
* [List description] * 列出文件
* @param [type] $path [description] *
* @param [type] $uid [description] * @param 路径 $path
* @param 用户UID $uid
* @param boolean $isShare 是否为分享模式下列出文件
* @return void
*/ */
static function ListFile($path,$uid){ static function ListFile($path,$uid,$isShare=false,$originPath=null){
$fileList = Db::name('files')->where('upload_user',$uid)->where('dir',$path)->select(); $fileList = Db::name('files')->where('upload_user',$uid)->where('dir',$path)->select();
$dirList = Db::name('folders')->where('owner',$uid)->where('position',$path)->select(); $dirList = Db::name('folders')->where('owner',$uid)->where('position',$path)->select();
$count= 0; $count= 0;
@ -657,6 +660,12 @@ class FileManage extends Model{
$fileListData['result'][$count]['id'] = $value['id']; $fileListData['result'][$count]['id'] = $value['id'];
$fileListData['result'][$count]['pic'] = ""; $fileListData['result'][$count]['pic'] = "";
$fileListData['result'][$count]['path'] = $value['position']; $fileListData['result'][$count]['path'] = $value['position'];
if($isShare){
if (substr($value['position'], 0, strlen($originPath)) == $originPath) {
$value['position'] = substr($value['position'], strlen($originPath));
}
$fileListData['result'][$count]['path'] = ($value['position']=="")?"/":$value['position'];
}
$count++; $count++;
} }
foreach ($fileList as $key => $value) { foreach ($fileList as $key => $value) {
@ -665,10 +674,15 @@ class FileManage extends Model{
$fileListData['result'][$count]['size'] = $value['size']; $fileListData['result'][$count]['size'] = $value['size'];
$fileListData['result'][$count]['date'] = $value['upload_date']; $fileListData['result'][$count]['date'] = $value['upload_date'];
$fileListData['result'][$count]['type'] = 'file'; $fileListData['result'][$count]['type'] = 'file';
$fileListData['result'][$count]['name2'] = $value["dir"];
$fileListData['result'][$count]['id'] = $value["id"]; $fileListData['result'][$count]['id'] = $value["id"];
$fileListData['result'][$count]['pic'] = $value["pic_info"]; $fileListData['result'][$count]['pic'] = $value["pic_info"];
$fileListData['result'][$count]['path'] = $value['dir']; $fileListData['result'][$count]['path'] = $value['dir'];
if($isShare){
if (substr($value['dir'], 0, strlen($originPath)) == $originPath) {
$value['dir'] = substr($value['dir'], strlen($originPath));
}
$fileListData['result'][$count]['path'] = ($value['dir']=="")?"/":$value['dir'];
}
$count++; $count++;
} }

@ -95,6 +95,28 @@ class ShareHandler extends Model{
return $fileObj->getThumb(); return $fileObj->getThumb();
} }
public function getDocPreview($user,$path){
$checkStatus = $this->checkSession($user);
if(!$checkStatus[0]){
return [$checkStatus[0],$checkStatus[1]];
}
$reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find();
$fileObj = new FileManage($reqPath["position_absolute"].$path,$this->shareData["owner"]);
$tmpUrl = $fileObj->signTmpUrl();
return[true,"http://view.officeapps.live.com/op/view.aspx?src=".urlencode($tmpUrl)];
}
public function getContent($user,$path=null){
$checkStatus = $this->checkSession($user);
if(!$checkStatus[0]){
return [$checkStatus[0],$checkStatus[1]];
}
$reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find();
$fileObj = new FileManage($reqPath["position_absolute"].$path,$this->shareData["owner"]);
$fileObj->getContent();
exit();
}
public function checkSession($user){ public function checkSession($user){
if($this->lockStatus){ if($this->lockStatus){
return [false,"会话过期,请刷新页面"]; return [false,"会话过期,请刷新页面"];
@ -146,7 +168,7 @@ class ShareHandler extends Model{
} }
$reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find(); $reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find();
$path = $path == "/"?"":$path; $path = $path == "/"?"":$path;
return FileManage::ListFile($this->shareData["source_name"].$path,$this->shareData["owner"]); return FileManage::ListFile($this->shareData["source_name"].$path,$this->shareData["owner"],true,$this->shareData["source_name"]);
} }
public function Preview($user){ public function Preview($user){

@ -1,6 +1,4 @@
{extend name="header_public" /}
{block name="title"}错误提示 - {$options.siteName}{/block}
{block name="content"}
<link rel="stylesheet" href="/static/css/error.css" /> <link rel="stylesheet" href="/static/css/error.css" />
</head> </head>
<body data-ma-header="teal"> <body data-ma-header="teal">
@ -19,6 +17,4 @@
</div> </div>
</div> </div>
</div> </div>
{$options.js_code}
</body> </body>
{/block}

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-cn"> <html lang="zh-cn">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="shortcut icon" href="/favicon.ico"> <link rel="shortcut icon" href="/favicon.ico">
@ -8,7 +9,7 @@
manifest.json provides metadata used when your web app is added to the manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/ homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> <link rel="manifest" href="/manifest.json">
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
@ -20,13 +21,54 @@
--> -->
<title>我的文件 - {$options.siteName}</title> <title>我的文件 - {$options.siteName}</title>
<script type="text/javascript"> <script type="text/javascript">
colorTheme = {
"palette": {
"common": {
"black": "#000",
"white": "#fff"
},
"background": {
"paper": "#fff",
"default": "#fafafa"
},
"primary": {
"light": "#7986cb",
"main": "#3f51b5",
"dark": "#303f9f",
"contrastText": "#fff"
},
"secondary": {
"light": "#ff4081",
"main": "#f50057",
"dark": "#c51162",
"contrastText": "#fff"
},
"error": {
"light": "#e57373",
"main": "#f44336",
"dark": "#d32f2f",
"contrastText": "#fff"
},
"text": {
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)"
},
"explorer": {
"filename": "#474849",
"icon": "#8f8f8f",
"bgSelected": "#D5DAF0",
"emptyIcon": "#e8e8e8",
}
}
};
isHomePage = true; isHomePage = true;
isSharePage = false;
uploadConfig = { uploadConfig = {
saveType: "{$policyData.policy_type}", saveType: "{$policyData.policy_type}",
maxSize: "{$policyData.max_size}mb", maxSize: "{$policyData.max_size}mb",
allowedType: [ allowedType: [{$extLimit}],
{$extLimit}
],
allowSource: "{$policyData.origin_link}", allowSource: "{$policyData.origin_link}",
upUrl: "{$policyData.server}", upUrl: "{$policyData.server}",
allowShare: "{$groupData.allow_share}", allowShare: "{$groupData.allow_share}",
@ -38,6 +80,7 @@
preview: "/File/Preview", preview: "/File/Preview",
download: "/File/Download", download: "/File/Download",
docPreiview: '/File/DocPreview', docPreiview: '/File/DocPreview',
listFile:"/File/ListFile"
}; };
userInfo = { userInfo = {
uid: {$userInfo.uid}, uid: {$userInfo.uid},
@ -55,6 +98,7 @@
isMobile = window.innerWidth < 600; isMobile = window.innerWidth < 600;
</script> </script>
</head> </head>
<body> <body>
<noscript> <noscript>
@ -72,9 +116,12 @@
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `npm run build` or `yarn build`.
--> -->
</body> </body>
<script src="http://192.168.123.19:3000/static/js/runtime~index.bundle.js"></script><script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script><script src="http://192.168.123.19:3000/static/js/3.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/runtime~index.bundle.js"></script>
<script src="http://192.168.123.19:3000/static/js/7.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/11.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/2.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/4.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/8.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/8.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/index.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/index.chunk.js"></script>
</html> </html>

@ -1,100 +0,0 @@
<!doctype html>
<html lang="zh_cn" data-ng-app="FileManagerApp">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<meta name="theme-color" content="#4e64d9"/>
<title>我的文件 - {$options.siteName}</title>
<script src="/static/js/angular.min.js"></script>
<script src="/static/js/angular-translate.min.js"></script>
<script src="/static/js/jquery.min.js"></script>
<link rel="stylesheet" href="/static/css/bootstrap.min.css" />
<link rel="stylesheet" href="/static/css/material.css" />
<script src="/static/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/static/css/font-awesome.min.css">
<link href="/static/css/angular-filemanager.min.css" rel="stylesheet">
<link href="/static/css/toastr.min.css" rel="stylesheet">
<script type="text/javascript" src="/static/js/toastr.min.js"></script>
<script src="/static/js/angular-filemanager.min.js"></script>
<link rel="stylesheet" href="/static/css/photoswipe.css">
<link rel="stylesheet" href="/static/css/default-skin/default-skin.css">
<script type="text/javascript">
uploadConfig={
saveType : "{$policyData.policy_type}",
maxSize : "{$policyData.max_size}mb",
allowedType: [
{$extLimit}
],
allowSource : "{$policyData.origin_link}",
upUrl : "{$policyData.server}",
allowShare:"{$groupData.allow_share}",
allowRemoteDownload:"{:explode(",",$groupData.aria2)[0]}",
allowTorrentDownload:"{:explode(",",$groupData.aria2)[1]}",
};
</script>
<script src="/static/js/home.js"></script>
</head>
<body class="ng-cloak">
<div id="container">
{include file="navbar_home" /}
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element, as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. -->
<div class="pswp__container">
<!-- don't modify these 3 pswp__item elements, data is added later on -->
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<div class="col-md-10 max_height">
<angular-filemanager></angular-filemanager>
</div>
</div>
</body>
<script src="/static/js/material.js"></script>
<script type="text/javascript">
upload_load=0;
</script>
{$options.js_code}
</html>

@ -1,80 +1,95 @@
{extend name="header_dir_share" /} <!DOCTYPE html>
{block name="title"}{$dirData.folder_name} - {$options.siteName}{/block} <html lang="zh-cn">
{block name="content"}
<link rel="stylesheet" href="/static/css/share_dir.css" />
<link rel="stylesheet" href="/static/css/photoswipe.css">
<link rel="stylesheet" href="/static/css/default-skin/default-skin.css">
</head>
<body data-ma-header="teal">
<div class="modal fade" id="previewModal" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" onclick="audioPause()" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only ng-binding">关闭</span>
</button>
<h4 class="modal-title">视频预览</h4>
</div>
<div class="modal-body">
<div class="text-center previewContent">
</div>
</div> <head>
</div> <meta charset="utf-8">
</div> <link rel="shortcut icon" href="/favicon.ico">
</div> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"> <!--
<!-- Background of PhotoSwipe. manifest.json provides metadata used when your web app is added to the
It's a separate element, as animating opacity is faster than rgba(). --> homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
<div class="pswp__bg"></div> -->
<!-- Slides wrapper with overflow:hidden. --> <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<div class="pswp__scroll-wrap"> <!--
<!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. --> Notice the use of %PUBLIC_URL% in the tags above.
<div class="pswp__container"> It will be replaced with the URL of the `public` folder during the build.
<!-- don't modify these 3 pswp__item elements, data is added later on --> Only files inside the `public` folder can be referenced from the HTML.
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<angular-filemanager></angular-filemanager>
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
</body> work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>{$dirData.folder_name} - {$options.siteName}</title>
<script type="text/javascript"> <script type="text/javascript">
colorTheme = {
"palette": {
"common": {
"black": "#000",
"white": "#fff"
},
"background": {
"paper": "#fff",
"default": "#fafafa"
},
"primary": {
"light": "#7986cb",
"main": "#3f51b5",
"dark": "#303f9f",
"contrastText": "#fff"
},
"secondary": {
"light": "#ff4081",
"main": "#f50057",
"dark": "#c51162",
"contrastText": "#fff"
},
"error": {
"light": "#e57373",
"main": "#f44336",
"dark": "#d32f2f",
"contrastText": "#fff"
},
"text": {
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)"
},
"explorer": {
"filename": "#474849",
"icon": "#8f8f8f",
"bgSelected": "#D5DAF0",
"emptyIcon": "#e8e8e8",
}
}
};
isHomePage = false;
isSharePage = true;
apiURL = {
imgThumb: "/Share/Thumb/{$shareData.share_key}",
preview: "/Share/Preview/{$shareData.share_key}",
download: "/Share/Download/{$shareData.share_key}",
docPreiview: '/Share/DocPreview/{$shareData.share_key}',
listFile:'/Share/ListFile/{$shareData.share_key}'
};
userInfo = {
uid: {$userData.uid},
nick: "{$userData.userNick}",
email: "{$userData.userMail}",
group: "{$userData.groupData.group_name}",
groupId: {$userData.groupData.id},
groupColor: "{$userData.groupData.color}",
};
siteInfo = {
mainTitle: "{$dirData.folder_name}",
};
path = "{$path}";
uploadConfig = {
allowSource: false,
allowShare: false,
allowRemoteDownload: "0",
allowTorrentDownload: "0",
};
shareInfo={ shareInfo={
shareDate : "{$shareData.share_time}", shareDate : "{$shareData.share_time}",
ownerUid:"{$userInfo.id}", ownerUid:"{$userInfo.id}",
@ -91,15 +106,36 @@
allowPreview:{$allowPreview}, allowPreview:{$allowPreview},
{/eq} {/eq}
}; };
mediaType = {},
isMobile = window.innerWidth < 600;
</script> </script>
<script src="/static/js/angular.min.js"></script> </head>
<script src="/static/js/angular-translate.min.js"></script>
<script src="/static/js/jquery.min.js"></script> <body>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/material.js"></script> <noscript>
<script src="/static/js/bootstrap.min.js"></script> You need to enable JavaScript to run this app.
<script type="text/javascript" src="/static/js/toastr.min.js"></script> </noscript>
<script src="/static/js/filemanager_share.js"></script> <div id="root"></div>
<script src="/static/js/share_dir.js"> </script> <!--
{$options.js_code} This HTML file is a template.
{/block} If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<script src="http://192.168.123.19:3000/static/js/runtime~folderShare.bundle.js"></script>
<script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/3.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/4.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/6.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/2.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/8.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/folderShare.chunk.js"></script>
</html>

@ -0,0 +1,105 @@
{extend name="header_dir_share" /}
{block name="title"}{$dirData.folder_name} - {$options.siteName}{/block}
{block name="content"}
<link rel="stylesheet" href="/static/css/share_dir.css" />
<link rel="stylesheet" href="/static/css/photoswipe.css">
<link rel="stylesheet" href="/static/css/default-skin/default-skin.css">
</head>
<body data-ma-header="teal">
<div class="modal fade" id="previewModal" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" onclick="audioPause()" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only ng-binding">关闭</span>
</button>
<h4 class="modal-title">视频预览</h4>
</div>
<div class="modal-body">
<div class="text-center previewContent">
</div>
</div>
</div>
</div>
</div>
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element, as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. -->
<div class="pswp__container">
<!-- don't modify these 3 pswp__item elements, data is added later on -->
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<angular-filemanager></angular-filemanager>
</body>
<script type="text/javascript">
shareInfo={
shareDate : "{$shareData.share_time}",
ownerUid:"{$userInfo.id}",
ownerNick:"{$userInfo.user_nick}",
downloadNum:"{$shareData.download_num}",
ViewNum:"{$shareData.view_num}",
shareId:"{$shareData.share_key}",
dirName:"{$dirData.folder_name}",
groupName:"{$groupData.group_name}",
color:"{$groupData.color}",
{eq name="$loginStatus" value="1"}
allowPreview:true,
{else/}
allowPreview:{$allowPreview},
{/eq}
};
</script>
<script src="/static/js/angular.min.js"></script>
<script src="/static/js/angular-translate.min.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/material.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/toastr.min.js"></script>
<script src="/static/js/filemanager_share.js"></script>
<script src="/static/js/share_dir.js"> </script>
{$options.js_code}
{/block}

@ -21,7 +21,50 @@
--> -->
<title>{$fileName} - {$options.siteName}</title> <title>{$fileName} - {$options.siteName}</title>
<script type="text/javascript"> <script type="text/javascript">
isHomePage = false, colorTheme = {
"palette": {
"common": {
"black": "#000",
"white": "#fff"
},
"background": {
"paper": "#fff",
"default": "#fafafa"
},
"primary": {
"light": "#7986cb",
"main": "#3f51b5",
"dark": "#303f9f",
"contrastText": "#fff"
},
"secondary": {
"light": "#ff4081",
"main": "#f50057",
"dark": "#c51162",
"contrastText": "#fff"
},
"error": {
"light": "#e57373",
"main": "#f44336",
"dark": "#d32f2f",
"contrastText": "#fff"
},
"text": {
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)"
},
"explorer": {
"filename": "#474849",
"icon": "#8f8f8f",
"bgSelected": "#D5DAF0",
"emptyIcon": "#e8e8e8",
}
}
};
isHomePage = false;
isSharePage = false;
apiURL={ apiURL={
imgThumb:"/File/Thumb", imgThumb:"/File/Thumb",
preview:"/File/Preview", preview:"/File/Preview",

@ -20,7 +20,50 @@
--> -->
<title>{$fileName} - {$options.siteName}</title> <title>{$fileName} - {$options.siteName}</title>
<script type="text/javascript"> <script type="text/javascript">
isHomePage = false, colorTheme = {
"palette": {
"common": {
"black": "#000",
"white": "#fff"
},
"background": {
"paper": "#fff",
"default": "#fafafa"
},
"primary": {
"light": "#7986cb",
"main": "#3f51b5",
"dark": "#303f9f",
"contrastText": "#fff"
},
"secondary": {
"light": "#ff4081",
"main": "#f50057",
"dark": "#c51162",
"contrastText": "#fff"
},
"error": {
"light": "#e57373",
"main": "#f44336",
"dark": "#d32f2f",
"contrastText": "#fff"
},
"text": {
"primary": "rgba(0, 0, 0, 0.87)",
"secondary": "rgba(0, 0, 0, 0.54)",
"disabled": "rgba(0, 0, 0, 0.38)",
"hint": "rgba(0, 0, 0, 0.38)"
},
"explorer": {
"filename": "#474849",
"icon": "#8f8f8f",
"bgSelected": "#D5DAF0",
"emptyIcon": "#e8e8e8",
}
}
};
isHomePage = false;
isSharePage = false;
apiURL={ apiURL={
imgThumb:"/File/Thumb", imgThumb:"/File/Thumb",
preview:"/File/Preview", preview:"/File/Preview",
@ -65,8 +108,8 @@
</body> </body>
<script src="http://192.168.123.19:3000/static/js/runtime~video.bundle.js"></script><script src="http://192.168.123.19:3000/static/js/5.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/runtime~video.bundle.js"></script><script src="http://192.168.123.19:3000/static/js/5.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/0.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/4.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/9.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/1.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/6.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/3.chunk.js"></script>
<script src="http://192.168.123.19:3000/static/js/video.chunk.js"></script> <script src="http://192.168.123.19:3000/static/js/video.chunk.js"></script>
</html> </html>

@ -24,4 +24,7 @@ Route::rule([
'Member/Avatar/:uid/:size' => ['Member/Avatar',[],['uid'=>'\d+']], 'Member/Avatar/:uid/:size' => ['Member/Avatar',[],['uid'=>'\d+']],
'Profile/:uid' => ['Profile/index',[],['uid'=>'\d+']], 'Profile/:uid' => ['Profile/index',[],['uid'=>'\d+']],
'Callback/Payment/Jinshajiang' => 'index/Callback/Jinshajiang', 'Callback/Payment/Jinshajiang' => 'index/Callback/Jinshajiang',
'Share/Thumb/:key' => 'index/Share/Thumb',
'Share/DocPreview/:key' => 'index/Share/DocPreview',
'Share/Content/:key' => 'index/Share/Content',
]); ]);
Loading…
Cancel
Save