Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hexbee
Cloudreve
提交
ef636bc2
C
Cloudreve
项目概览
hexbee
/
Cloudreve
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cloudreve
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ef636bc2
编写于
3月 14, 2019
作者:
H
HFO4
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Feat: My share
上级
3a491208
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
199 addition
and
163 deletion
+199
-163
application/index/controller/Share.php
application/index/controller/Share.php
+26
-15
application/index/model/ShareHandler.php
application/index/model/ShareHandler.php
+4
-2
application/index/view/home/home.html
application/index/view/home/home.html
+4
-3
application/index/view/share/share_home.html
application/index/view/share/share_home.html
+67
-90
application/index/view/share/share_homr_old.html
application/index/view/share/share_homr_old.html
+98
-0
application/index/view/share/share_lock_old.html
application/index/view/share/share_lock_old.html
+0
-53
未找到文件。
application/index/controller/Share.php
浏览文件 @
ef636bc2
...
...
@@ -222,36 +222,39 @@ class Share extends Controller{
$shareId
=
input
(
'post.id'
);
$shareObj
=
new
ShareHandler
(
$shareId
,
false
);
if
(
!
$shareObj
->
querryStatus
){
return
array
(
return
json
(
array
(
"error"
=>
1
,
"msg"
=>
"分享不存在"
);
)
)
;
}
return
$shareObj
->
deleteShare
(
$this
->
userObj
->
uid
);
return
json
(
$shareObj
->
deleteShare
(
$this
->
userObj
->
uid
)
);
}
public
function
ChangePromission
(){
$shareId
=
input
(
'post.id'
);
$shareObj
=
new
ShareHandler
(
$shareId
,
false
);
if
(
!
$shareObj
->
querryStatus
){
return
array
(
return
json
(
array
(
"error"
=>
1
,
"msg"
=>
"分享不存在"
);
)
)
;
}
return
$shareObj
->
changePromission
(
$this
->
userObj
->
uid
);
return
json
(
$shareObj
->
changePromission
(
$this
->
userObj
->
uid
)
);
}
public
function
My
(){
public
function
ListMyShare
(){
if
(
!
$this
->
userObj
->
loginStatus
){
$this
->
redirect
(
url
(
'/Login'
,
''
,
''
));
exit
();
}
$userInfo
=
$this
->
userObj
->
getInfo
();
$groupData
=
$this
->
userObj
->
getGroupData
();
$list
=
Db
::
name
(
'shares'
)
->
where
(
'owner'
,
$this
->
userObj
->
uid
)
->
order
(
'share_time DESC'
)
->
paginate
(
30
);
$listData
=
$list
->
all
();
$list
=
Db
::
name
(
'shares'
)
->
where
(
'owner'
,
$this
->
userObj
->
uid
)
->
order
(
'share_time DESC'
)
->
page
(
input
(
"post.page"
)
.
",18"
)
->
select
();
$listData
=
$list
;
foreach
(
$listData
as
$key
=>
$value
)
{
unset
(
$listData
[
$key
][
"source_name"
]);
if
(
$value
[
"source_type"
]
==
"file"
){
$listData
[
$key
][
"fileData"
]
=
Db
::
name
(
'files'
)
->
where
(
'id'
,
$value
[
"source_name"
])
->
find
()[
"orign_name"
];
...
...
@@ -259,12 +262,20 @@ class Share extends Controller{
$listData
[
$key
][
"fileData"
]
=
$value
[
"source_name"
];
}
}
return
json
(
$listData
);
}
public
function
My
(){
if
(
!
$this
->
userObj
->
loginStatus
){
$this
->
redirect
(
url
(
'/Login'
,
''
,
''
));
exit
();
}
$userInfo
=
$this
->
userObj
->
getInfo
();
$groupData
=
$this
->
userObj
->
getGroupData
();
return
view
(
'share_home'
,
[
'options'
=>
Option
::
getValues
([
'basic'
,
'share'
]),
'user
Info
'
=>
$userInfo
,
'options'
=>
Option
::
getValues
([
'basic'
,
'share'
]
,
$this
->
userObj
->
userSQLData
),
'user
Data
'
=>
$userInfo
,
'groupData'
=>
$groupData
,
'list'
=>
$listData
,
'listOrigin'
=>
$list
]);
}
...
...
application/index/model/ShareHandler.php
浏览文件 @
ef636bc2
...
...
@@ -57,13 +57,15 @@ class ShareHandler extends Model{
"msg"
=>
"无权操作"
);
}
$newPwd
=
self
::
getRandomKey
(
6
);
Db
::
name
(
'shares'
)
->
where
(
'share_key'
,
$this
->
shareData
[
"share_key"
])
->
update
([
'type'
=>
$this
->
shareData
[
"type"
]
==
"public"
?
"private"
:
"public"
,
'share_pwd'
=>
self
::
getRandomKey
(
6
)
'share_pwd'
=>
$newPwd
]);
return
array
(
"error"
=>
0
,
"msg"
=>
"更改成功"
"msg"
=>
"更改成功"
,
"newPwd"
=>
$newPwd
,
);
}
...
...
application/index/view/home/home.html
浏览文件 @
ef636bc2
...
...
@@ -84,10 +84,11 @@
<script
src=
"http://192.168.123.19:3000/static/js/3.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/5.chunk.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/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/11.chunk.js"
></script>
<script
src=
"http://192.168.123.19:3000/static/js/10.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/8.chunk.js"
></script>
<script
src=
"http://192.168.123.19:3000/static/js/12.chunk.js"
></script>
<script
src=
"http://192.168.123.19:3000/static/js/index.chunk.js"
></script>
</html>
\ No newline at end of file
application/index/view/share/share_home.html
浏览文件 @
ef636bc2
{extend name="header_home" /}
{block name="title"}我的分享- {$options.siteName}{/block}
{block name="content"}
<script
src=
"/static/js/share_home.js"
></script>
</head>
<body
>
<!DOCTYPE html>
<html
lang=
"zh-cn"
>
<head>
<meta
charset=
"utf-8"
>
<link
rel=
"shortcut icon"
href=
"/favicon.ico"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no"
>
<meta
name=
"theme-color"
content=
"{$options.themeColor}"
/>
<!--
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/
-->
<link
rel=
"manifest"
href=
"/manifest.json"
>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
<div
class=
"modal fade bs-example-modal-sm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"mySmallModalLabel"
id=
"deleteConfirm"
>
<div
class=
"modal-dialog modal-sm"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
确认
</h4>
</div>
<div
class=
"modal-body"
>
您确定要取消此分享吗?
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn pro-btn"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary pro-btn"
onclick=
"deleteConfirm();"
>
确定
</button>
</div>
</div>
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
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>
我的分享- {$options.siteName}
</title>
<script
type=
"text/javascript"
>
colorTheme
=
{:
json_encode
(
$options
[
"
themeConfig
"
])};
isHomePage
=
false
;
isSharePage
=
false
;
pageId
=
"
shareLock
"
;
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
:
"
{$options.siteName}
"
,
};
uploadConfig
=
{
allowSource
:
false
,
allowShare
:
false
,
allowRemoteDownload
:
"
0
"
,
allowTorrentDownload
:
"
0
"
,
};
isMobile
=
window
.
innerWidth
<
600
;
</script>
</head>
</div>
</div>
<div
class=
"modal fade bs-example-modal-sm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"mySmallModalLabel"
id=
"changeConfirm"
>
<div
class=
"modal-dialog modal-sm"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
确认
</h4>
</div>
<div
class=
"modal-body"
>
您确定要将此分享改为
<span
id=
"shareType"
></span>
?
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn pro-btn"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary pro-btn"
onclick=
"changeConfirm();"
>
确定
</button>
</div>
</div>
<body>
</div>
</div>
<div
id=
"container"
>
{include file="navbar_home" /}
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div
id=
"root"
></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
<div
class=
"col-md-10 share-content"
>
<h1>
我的分享
</h1>
<br>
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered table-hover"
>
<thead>
<tr>
<th
width=
"50%"
>
文件名
</th>
<th
class=
"table_center"
>
分享日期
</th>
<th
class=
"table_center"
>
分享类型
</th>
<th
class=
"table_center"
>
下载次数
</th>
<th
class=
"table_center"
>
浏览次数
</th>
<th
class=
"table_center"
>
操作
</th>
</tr>
</thead>
<tbody>
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
{volist name='list' id='shares'}
<tr
id=
"{$shares.share_key}"
>
<td
>
{switch $shares.source_type}
{case file}
<i
class=
"fa fa-file"
aria-hidden=
"true"
></i>
{/case}
{case dir}
<i
class=
"fa fa-folder-open blue"
aria-hidden=
"true"
></i>
{/case}
{/switch} {$shares.fileData}
</td>
<td
align=
"center"
>
{$shares.share_time}
</td>
<td
align=
"center"
>
{switch $shares.type}
{case private}
<button
class=
"btn btn-default small-btn"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"密码:{$shares.share_pwd},点击变更公开类型"
onclick=
"changeType('{$shares.share_key}','private')"
><i
class=
"fa fa-lock"
aria-hidden=
"true"
></i></button>
{/case}
{case public}
<button
class=
"btn btn-default small-btn"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"变更公开类型"
onclick=
"changeType('{$shares.share_key}','public')"
><i
class=
"fa fa-eye"
aria-hidden=
"true"
></i></button>
{/case}
{/switch}
</td>
<td
align=
"center"
>
{$shares.download_num}
</td>
<td
align=
"center"
>
{$shares.view_num}
</td>
<td
align=
"center"
><button
class=
"btn btn-info small-btn-border"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"查看分享"
onclick=
"openShare('{$shares.share_key}')"
><i
class=
"fa fa-share-square"
aria-hidden=
"true"
></i></button>
<button
class=
"btn btn-danger small-btn-border"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"删除分享"
onclick=
"deleteShare('{$shares.share_key}')"
><i
class=
"fa fa-times"
aria-hidden=
"true"
></i></button>
<button
class=
"btn btn-success small-btn-border"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"变更公开类型"
onclick=
"changeType('{$shares.share_key}','{$shares.type}')"
><i
class=
"fa fa-unlock-alt"
aria-hidden=
"true"
></i></button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{$listOrigin->render()}
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=
"/static/js/material.js"
></script>
<script
type=
"text/javascript"
>
upload_load
=
0
;
<script
src=
"http://192.168.123.19:3000/static/js/runtime~myShare.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/2.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/7.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/myShare.chunk.js"
></script>
</script>
{$options.js_code}
</html>
{/block}
\ No newline at end of file
</html>
\ No newline at end of file
application/index/view/share/share_homr_old.html
0 → 100644
浏览文件 @
ef636bc2
{extend name="header_home" /}
{block name="title"}我的分享- {$options.siteName}{/block}
{block name="content"}
<script
src=
"/static/js/share_home.js"
></script>
</head>
<body
>
<div
class=
"modal fade bs-example-modal-sm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"mySmallModalLabel"
id=
"deleteConfirm"
>
<div
class=
"modal-dialog modal-sm"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
确认
</h4>
</div>
<div
class=
"modal-body"
>
您确定要取消此分享吗?
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn pro-btn"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary pro-btn"
onclick=
"deleteConfirm();"
>
确定
</button>
</div>
</div>
</div>
</div>
<div
class=
"modal fade bs-example-modal-sm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"mySmallModalLabel"
id=
"changeConfirm"
>
<div
class=
"modal-dialog modal-sm"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
确认
</h4>
</div>
<div
class=
"modal-body"
>
您确定要将此分享改为
<span
id=
"shareType"
></span>
?
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn pro-btn"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary pro-btn"
onclick=
"changeConfirm();"
>
确定
</button>
</div>
</div>
</div>
</div>
<div
id=
"container"
>
{include file="navbar_home" /}
<div
class=
"col-md-10 share-content"
>
<h1>
我的分享
</h1>
<br>
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered table-hover"
>
<thead>
<tr>
<th
width=
"50%"
>
文件名
</th>
<th
class=
"table_center"
>
分享日期
</th>
<th
class=
"table_center"
>
分享类型
</th>
<th
class=
"table_center"
>
下载次数
</th>
<th
class=
"table_center"
>
浏览次数
</th>
<th
class=
"table_center"
>
操作
</th>
</tr>
</thead>
<tbody>
{volist name='list' id='shares'}
<tr
id=
"{$shares.share_key}"
>
<td
>
{switch $shares.source_type}
{case file}
<i
class=
"fa fa-file"
aria-hidden=
"true"
></i>
{/case}
{case dir}
<i
class=
"fa fa-folder-open blue"
aria-hidden=
"true"
></i>
{/case}
{/switch} {$shares.fileData}
</td>
<td
align=
"center"
>
{$shares.share_time}
</td>
<td
align=
"center"
>
{switch $shares.type}
{case private}
<button
class=
"btn btn-default small-btn"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"密码:{$shares.share_pwd},点击变更公开类型"
onclick=
"changeType('{$shares.share_key}','private')"
><i
class=
"fa fa-lock"
aria-hidden=
"true"
></i></button>
{/case}
{case public}
<button
class=
"btn btn-default small-btn"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"变更公开类型"
onclick=
"changeType('{$shares.share_key}','public')"
><i
class=
"fa fa-eye"
aria-hidden=
"true"
></i></button>
{/case}
{/switch}
</td>
<td
align=
"center"
>
{$shares.download_num}
</td>
<td
align=
"center"
>
{$shares.view_num}
</td>
<td
align=
"center"
><button
class=
"btn btn-info small-btn-border"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"查看分享"
onclick=
"openShare('{$shares.share_key}')"
><i
class=
"fa fa-share-square"
aria-hidden=
"true"
></i></button>
<button
class=
"btn btn-danger small-btn-border"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"删除分享"
onclick=
"deleteShare('{$shares.share_key}')"
><i
class=
"fa fa-times"
aria-hidden=
"true"
></i></button>
<button
class=
"btn btn-success small-btn-border"
data-toggle=
"tooltip"
data-placement=
"top"
title=
"变更公开类型"
onclick=
"changeType('{$shares.share_key}','{$shares.type}')"
><i
class=
"fa fa-unlock-alt"
aria-hidden=
"true"
></i></button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{$listOrigin->render()}
</body>
<script
src=
"/static/js/material.js"
></script>
<script
type=
"text/javascript"
>
upload_load
=
0
;
</script>
{$options.js_code}
</html>
{/block}
\ No newline at end of file
application/index/view/share/share_lock_old.html
已删除
100644 → 0
浏览文件 @
3a491208
{extend name="header_public" /}
{block name="title"}私密分享 - {$options.siteName}{/block}
{block name="content"}
<link
rel=
"stylesheet"
href=
"/static/css/share.css"
/>
<link
rel=
"stylesheet"
href=
"/static/css/lock.css"
/>
<script
src=
"/static/js/jquery.color.js"
></script>
</head>
<body
data-ma-header=
"teal"
>
<nav
class=
"navbar navbar-inverse"
>
<div
class=
"container-fluid"
>
<div
class=
"container"
>
{include file="navbar_public" loginStatus=$loginStatus userData=$userData /}
<div
class=
"header-panel shadow-z-2"
>
<div
class=
"container-fluid"
>
<div
class=
"row"
>
</div>
</div>
</div>
<div
class=
"container main"
>
<div
class=
"col-md-4"
></div>
<div
class=
"col-md-4"
>
<div
class=
"jumbotron"
>
<div
class=
"card_top"
>
<div
class=
"row top-color"
>
<div
class=
"card-top-row"
>
加密分享
</div>
</div>
</div>
<div
class=
"card_botom"
>
<div
class=
"row bottom-width"
align=
"right"
>
<input
type=
"password"
class=
"form-control"
id=
"inputPassword"
placeholder=
"请输入分享密码"
value=
"{$pwd}"
>
<button
href=
"javascript:void(0)"
id=
"submit_pwd"
class=
"btn btn-raised active"
><i
class=
"fa fa-arrow-right"
aria-hidden=
"true"
></i></button>
</div>
</div>
</div>
<div
class=
"col-md-4"
></div>
</div>
</div>
</body>
<script
src=
"/static/js/jquery.liMarquee.js"
></script>
<script
type=
"text/javascript"
>
shareInfo
=
{
shareId
:
"
{$shareData.share_key}
"
,
};
</script>
<script
src=
"/static/js/lock.js"
>
</script>
{$options.js_code}
{/block}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录