最近get到一个类似h5ai的单文件列目录程序,风格简洁,h5适配好,拿来做文件分享和下载站很不错,跟大家安利一下。

演示地址:http://d.nat.ee/

官网地址:https://files.photo.gallery/

程序下载地址:

https://cdn.jsdelivr.net/npm/files.photo.gallery/index.php

如何去掉授权提示信息?

编辑文件末尾,把


<span class="pln">&lt;script src="</span><span class="pun">&lt;?</span><span class="pln">php echo config</span><span class="pun">::</span><span class="pln">$assets </span><span class="pun">?&gt;</span><span class="pln">js</span><span class="pun">/</span><span class="pln">files</span><span class="pun">.</span><span class="pln">js</span><span class="str">"&gt;</span><span class="tag">&lt;/script&gt;</span>

修改为:


<span class="tag">&lt;script</span> <span class="atn">src</span><span class="pun">=</span><span class="atv">"http://d.nat.ee/js/files.js"</span><span class="tag">&gt;&lt;/script&gt;</span>

如果不想引用第三方地址,自己下载下来引用本地文件就好了。


<span class="tag">&lt;script</span> <span class="atn">src</span><span class="pun">=</span><span class="atv">"js/files.js"</span><span class="tag">&gt;&lt;/script&gt;</span>

配置根目录、密码访问和排除不需要显示的目录:


<span class="com">// 根目录配置</span>
<span class="str">'root'</span> <span class="pun">=&gt;</span> <span class="str">'根目录路径'</span><span class="pun">,</span> <span class="com">// root path relative to script.</span>
<span class="str">'start_path'</span> <span class="pun">=&gt;</span> <span class="kwd">false</span><span class="pun">,</span> <span class="com">// start path relative to script. If empty, root is start path</span>

<span class="com">// 登录账号密码配置</span>
<span class="str">'username'</span> <span class="pun">=&gt;</span> <span class="str">'zhujizixun'</span><span class="pun">,</span>
<span class="str">'password'</span> <span class="pun">=&gt;</span> <span class="str">'12345678'</span><span class="pun">,</span> <span class="com">// Add password directly or use https://tinyfilemanager.github.io/docs/pwd.html to encrypt the password (encrypted password is more secure, as it prevents your password from being exposed directly in a file).</span>

<span class="com">// 排除文件或者目录</span>
<span class="str">'files_exclude'</span> <span class="pun">=&gt;</span> <span class="str">'/.(html|xml)$/i'</span><span class="pun">,</span> <span class="com">// '/.(pdf|jpe?g)$/i'</span>
<span class="str">'dirs_exclude'</span> <span class="pun">=&gt;</span> <span class="str">'//js|/_files(/|$)/i'</span><span class="pun">,</span> <span class="com">//'//Convert|/football|/node_modules(/|$)/i',</span>
<span class="str">'allow_symlinks'</span> <span class="pun">=&gt;</span> <span class="kwd">true</span><span class="pun">,</span> <span class="com">// allow symlinks</span>

发表评论

共有 0 条评论