Skip to content

Commit 04ac72d

Browse files
committed
修复全站验证开关无效的问题,优化视频播放功能调用细节
[修复] 全站验证开关无效的问题 [优化] 视频播放功能调用细节
1 parent 47ae0d3 commit 04ac72d

6 files changed

Lines changed: 24 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# hfs4OSS
22

33
## 更新日志/ChangeLog
4+
### version 2.4.1 2019-03-26
5+
```
6+
[修复] 全站验证开关无效的问题
7+
[优化] 视频播放功能调用细节
8+
```
49
### version 2.4.1 2018-11-28
510
```
611
[修复] 导致IE下无法使用的部分问题

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SDK:aliyun-oss-php-[sdk](https://promotion.aliyun.com/ntms/act/ossdoclist.html
77
样式:[h5ai](https://larsjung.de/h5ai/) v0.29.0
88

99
## 预览/Demo
10-
* oovoo.site:[http://file.oovoo.site/](http://file.oovoo.site/)
10+
* [http://file.oovoo.site/](http://file.oovoo.site/)
1111
* ![image](https://yxuuan.github.io/hfs4oss-demo/v2.2.0.png)
1212

1313
## 部署/Build
@@ -17,7 +17,7 @@ PHP 5 >= 5.3,cURL()支持
1717
Releases:[https://github.com/YXuuan/hfs4OSS/releases/](https://github.com/YXuuan/hfs4OSS/releases/)
1818
或使用git:
1919
~~~
20-
git clone https://github.com/YXuuan/hfs4OSS.git
20+
# git clone https://github.com/YXuuan/hfs4OSS.git
2121
~~~
2222
* 更新:
2323
Releases:[https://github.com/YXuuan/hfs4OSS/releases/](https://github.com/YXuuan/hfs4OSS/releases/)
@@ -87,17 +87,16 @@ FOOTER :(str)底部Footer的HTML代码;
8787
```
8888
## 更新日志/ChangeLog
8989
```
90-
version 2.4.0 2018-06-17
91-
[新增] 视频在线播放
92-
[优化] 前端运行逻辑
93-
[优化] 前端显示细节,修改默认字体
90+
version 2.4.1 2019-03-26
91+
[修复] 全站验证开关无效的问题
92+
[优化] 视频播放功能调用细节
9493
```
9594
更多:[CHANGELOG.md](https://github.com/YXuuan/hfs4OSS/blob/master/CHANGELOG.md)
9695

9796
## 使用到的开源项目/Reference
98-
* lrsjng/h5ai
97+
* lrsjng/h5ai(MIT)
9998
https://github.com/lrsjng/h5ai
100-
* MoePlayer/DPlayer
99+
* MoePlayer/DPlayer(MIT)
101100
https://github.com/MoePlayer/DPlayer
102101

103102
## 已知的问题/Problems

app/action/listObjects.action.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
//foreach的作用只是用来找到经过上面排序后的AUTH中符合当前请求路径的第一个,每个分支验证密码成功后都break,也就是说通过上面的排序后,只验证AUTH中距离最接近本次请求路径最接近的那个,即为验证成功
88
$prefixWithoutRootDir = str_replace_limit($APPConfig['ROOT_DIR'], "", $eachAuth['PATH'], 1); //ROOT_DIR对前端不可视,传入的cookies中不包含ROOT_DIR前缀,故与AppConfig中的路径比较时要截掉每一个key的ROOT_DIR前缀部分
99
substr($_POST['prefix'], 0, strlen($prefixWithoutRootDir)) == $prefixWithoutRootDir;
10-
if(($_POST['prefix'] == $prefixWithoutRootDir) || (substr($_POST['prefix'], 0, strlen($prefixWithoutRootDir)) == $prefixWithoutRootDir)){
10+
if(
11+
($eachAuth['ENABLED'] == true) &&
12+
(
13+
($_POST['prefix'] == $prefixWithoutRootDir) ||
14+
(substr($_POST['prefix'], 0, strlen($prefixWithoutRootDir)) == $prefixWithoutRootDir)
15+
)
16+
){
1117
$autoPassword = @check_var($hfs4OSS_cookies['passwords'][$prefixWithoutRootDir]) ? $hfs4OSS_cookies['passwords'][$prefixWithoutRootDir] : (@check_var($hfs4OSS_cookies['passwords'][$_POST['prefix']]) ? $hfs4OSS_cookies['passwords'][$_POST['prefix']] : null); //任选其一做为验证的密码
1218
$resultToSendBack['authedPrefix'] = $prefixWithoutRootDir; //用于前端接管:密码赋值到Cookies中和AUTH对应的正确路径
1319
if(!$autoPassword){

app/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$hfs4OSS_cookies = @check_var($_COOKIE['hfs4OSS_cookies']) ? json_decode($_COOKIE['hfs4OSS_cookies'], true) : null;
99
$resultToSendBack = array();
1010

11-
if($APPConfig['ROOT_AUTH']['PASSWORD'] == true){
11+
if($APPConfig['ROOT_AUTH']['ENABLED'] == true){
1212
if(!@check_var($hfs4OSS_cookies['passwords']['index'])){
1313
$resultToSendBack['stat'] = 201;
1414
$resultToSendBack['msg'] = $APPConfig['ROOT_AUTH']['FIRSTMET'];

ext/DPlayer/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
const dp = new DPlayer({
1414
container: document.getElementById('dplayer'),
1515
video: {
16-
url: window.location.hash.substring(1),
16+
url: decodeURIComponent(window.location.hash.substring(1)),
1717
},
1818
autoplay: true,
1919
});

static/script/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ $(document).ready(function(){
6161
}
6262
$(this).parent("a").parent("li").attr('style', 'opacity: 1.0;-moz-opacit: 1.0;');
6363
});
64+
//Action: Play按钮播放视频
6465
$("#list").on("click", "li.item.file .icon.square-action", function(event){
65-
$(this).parent("a").attr("href", "ext/DPlayer/index.html#" + getSignedUrlForGettingObject($(this).parent("a").parent("li").attr("data"))).attr("target", "_blank");
66+
$(this).parent("a").attr("target", "_blank");
67+
$(this).parent("a").attr("href", "ext/DPlayer/index.html#" + encodeURIComponent(getSignedUrlForGettingObject($(this).parent("a").parent("li").attr("data"))));
6668
});
6769
});
6870
function listObjects(){

0 commit comments

Comments
 (0)