修改文件上传配置

This commit is contained in:
Anyon 2019-12-20 14:33:43 +08:00
parent adf29036b6
commit 368a8b60cb
3 changed files with 61 additions and 28 deletions

View File

@ -1,8 +1,9 @@
<form onsubmit="return false" data-auto="true" action="{:url()}" method="post" class='layui-form layui-card' autocomplete="off">
<div class="layui-card-body">
<div class="color-text margin-left-40 margin-bottom-20 layui-code" style="border-left-width:1px;background:none">
<p class="margin-bottom-5 font-w7">文件将上传到阿里云OSS空间需要配置OSS公开访问及跨域策略目前已实现自动创建空间及配置访问策略</p>
<div class="color-text margin-left-40 margin-bottom-20 layui-code text-center layui-bg-gray" style="border-left-width:1px">
<p class="margin-bottom-5 font-w7">文件将上传到阿里云 OSS 存储,需要配置 OSS 公开访问及跨域策略。</p>
<p>直传需要配置跨域规则,设置来源为 *,允许 Methods 为 POST允许 Headers 为 *</p>
</div>
<div class="layui-form-item">

View File

@ -1,20 +1,28 @@
<form onsubmit="return false;" data-auto="true" action="{:url()}" method="post" class='layui-form layui-card' autocomplete="off">
<div class="layui-card-body">
<div class="color-text margin-left-40 margin-bottom-20 layui-code" style="border-left-width:1px;background:none">
<p>文件将存储在本地服务器,需确保服务器的 public/upload 目录有写入权限,有足够的存储空间!</p>
<div class="color-text margin-left-40 margin-bottom-20 layui-code text-center layui-bg-gray" style="border-left-width:1px">
<p class="margin-bottom-5 font-w7">文件将存储在本地服务器,默认保存在 public/upload 目录,文件以 HASH 命名。</p>
<p>文件存储的目录需要有读写权限,有足够的存储空间</p>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span class="color-green font-w7">AllowExts</span><br><span class="nowrap color-desc">允许类型</span></label>
<label class="layui-form-label" for="storage.allow_exts">
<span class="color-green font-w7">AllowExts</span><br><span class="nowrap color-desc">允许类型</span>
</label>
<div class="layui-input-block">
<input type="text" name="storage.allow_exts" required value="{:sysconf('storage.allow_exts')}" placeholder="请输入系统文件上传后缀" class="layui-input">
<input id="storage.allow_exts" type="text" name="storage.allow_exts" required value="{:sysconf('storage.allow_exts')}" placeholder="请输入系统文件上传后缀" class="layui-input">
<p class="help-block">设置系统允许上传文件的后缀多个以英文逗号隔开。如png,jpg,rar,doc</p>
</div>
</div>
<div class="hr-line-dashed margin-left-40"></div>
<input type="hidden" name="storage.type" value="local">
<div class="layui-form-item text-center padding-left-40">
<input type="hidden" name="storage.type" value="local">
<button class="layui-btn" type="submit">保存配置</button>
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消修改吗?" data-close>取消修改</button>
</div>
</div>
</form>

View File

@ -1,18 +1,25 @@
<form onsubmit="return false" data-auto="true" action="{:url()}" method="post" class='layui-form layui-card' autocomplete="off">
<div class="layui-card-body">
<div class="color-text margin-left-40 margin-bottom-20 layui-code" style="border-left-width:1px;background:none">
<p class="margin-bottom-5 font-w7">文件将上传到七牛云存储对象存储需要配置为公开访问的Bucket空间</p>
<div class="color-text margin-left-40 margin-bottom-20 layui-code text-center layui-bg-gray" style="border-left-width:1px">
<p class="margin-bottom-5 font-w7">文件将上传到七牛云存储,对象存储需要配置为公开访问的 Bucket 空间。</p>
完成实名认证后可获得10G免费存储空间哦<a target="_blank" href="https://portal.qiniu.com/signup?code=3lhz6nmnwbple">我要免费申请</a>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span class="color-green font-w7">AllowExts</span><br><span class="nowrap color-desc">允许类型</span></label>
<label class="layui-form-label" for="storage.allow_exts">
<span class="color-green font-w7">AllowExts</span><br><span class="nowrap color-desc">允许类型</span>
</label>
<div class="layui-input-block">
<input type="text" name="storage.allow_exts" required value="{:sysconf('storage.allow_exts')}" placeholder="请输入系统文件上传后缀" class="layui-input">
<input id="storage.allow_exts" type="text" name="storage.allow_exts" required value="{:sysconf('storage.allow_exts')}" placeholder="请输入系统文件上传后缀" class="layui-input">
<p class="help-block">设置系统允许上传文件的后缀多个以英文逗号隔开。如png,jpg,rar,doc</p>
</div>
</div>
<div class="layui-form-item" data-storage-type="qiniu">
<label class="layui-form-label label-required"><span class="color-green font-w7">Protocol</span><br><span class="nowrap color-desc">访问协议</span></label>
<div class="layui-form-item">
<label class="layui-form-label label-required">
<span class="color-green font-w7">Protocol</span><br><span class="nowrap color-desc">访问协议</span>
</label>
<div class="layui-input-block">
{foreach ['http','https','auto'] as $pro}
<label class="think-radio">
@ -26,8 +33,11 @@
<p class="help-block">七牛云存储访问协议,其中 https 需要配置证书才能使用auto 为相对协议。</p>
</div>
</div>
<div class="layui-form-item" data-storage-type="qiniu">
<label class="layui-form-label"><span class="color-green font-w7">Region</span><br><span class="nowrap color-desc label-required">存储区域</span></label>
<div class="layui-form-item">
<label class="layui-form-label">
<span class="color-green font-w7">Region</span><br><span class="nowrap color-desc label-required">存储区域</span>
</label>
<div class="layui-input-block">
{foreach ['华东','华北','华南','北美'] as $area}
<label class="think-radio">
@ -42,37 +52,51 @@
<p class="help-block">七牛云存储空间所在区域,需要严格对应储存所在区域才能上传文件。</p>
</div>
</div>
<div class="layui-form-item" data-storage-type="qiniu">
<label class="layui-form-label"><span class="color-green font-w7">Bucket</span><br><span class="nowrap color-desc">空间名称</span></label>
<div class="layui-form-item">
<label class="layui-form-label" for="storage.qiniu_bucket">
<span class="color-green font-w7">Bucket</span><br><span class="nowrap color-desc">空间名称</span>
</label>
<div class="layui-input-block">
<input type="text" name="storage.qiniu_bucket" required value="{:sysconf('storage.qiniu_bucket')}" placeholder="请输入七牛云存储 Bucket (空间名称)" class="layui-input">
<input id="storage.qiniu_bucket" type="text" name="storage.qiniu_bucket" required value="{:sysconf('storage.qiniu_bucket')}" placeholder="请输入七牛云存储 Bucket (空间名称)" class="layui-input">
<p class="help-block">填写七牛云存储空间名称static</p>
</div>
</div>
<div class="layui-form-item" data-storage-type="qiniu">
<label class="layui-form-label"><span class="color-green font-w7">Domain</span><br><span class="nowrap color-desc">访问域名</span></label>
<div class="layui-form-item">
<label class="layui-form-label" for="storage.qiniu_http_domain">
<span class="color-green font-w7">Domain</span><br><span class="nowrap color-desc">访问域名</span>
</label>
<div class="layui-input-block">
<input type="text" name="storage.qiniu_http_domain" required value="{:sysconf('storage.qiniu_http_domain')}" placeholder="请输入七牛云存储 Domain (访问域名)" class="layui-input">
<input id="storage.qiniu_http_domain" type="text" name="storage.qiniu_http_domain" required value="{:sysconf('storage.qiniu_http_domain')}" placeholder="请输入七牛云存储 Domain (访问域名)" class="layui-input">
<p class="help-block">填写七牛云存储访问域名static.ctolog.com</p>
</div>
</div>
<div class="layui-form-item" data-storage-type="qiniu">
<label class="layui-form-label"><span class="color-green font-w7">AccessKey</span><br><span class="nowrap color-desc">访问密钥</span></label>
<div class="layui-form-item">
<label class="layui-form-label" for="storage.qiniu_access_key">
<span class="color-green font-w7">AccessKey</span><br><span class="nowrap color-desc">访问密钥</span>
</label>
<div class="layui-input-block">
<input type="text" name="storage.qiniu_access_key" required value="{:sysconf('storage.qiniu_access_key')}" placeholder="请输入七牛云 AccessKey (访问密钥)" class="layui-input">
<input id="storage.qiniu_access_key" type="text" name="storage.qiniu_access_key" required value="{:sysconf('storage.qiniu_access_key')}" placeholder="请输入七牛云 AccessKey (访问密钥)" class="layui-input">
<p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到访问密钥。</p>
</div>
</div>
<div class="layui-form-item" data-storage-type="qiniu">
<label class="layui-form-label"><span class="color-green font-w7">SecretKey</span><br><span class="nowrap color-desc">安全密钥</span></label>
<div class="layui-form-item">
<label class="layui-form-label" for="storage.qiniu_secret_key">
<span class="color-green font-w7">SecretKey</span><br><span class="nowrap color-desc">安全密钥</span>
</label>
<div class="layui-input-block">
<input type="text" name="storage.qiniu_secret_key" required value="{:sysconf('storage.qiniu_secret_key')}" maxlength="43" placeholder="请输入七牛云 SecretKey (安全密钥)" class="layui-input">
<input id="storage.qiniu_secret_key" type="text" name="storage.qiniu_secret_key" required value="{:sysconf('storage.qiniu_secret_key')}" maxlength="43" placeholder="请输入七牛云 SecretKey (安全密钥)" class="layui-input">
<p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到安全密钥。</p>
</div>
</div>
<div class="hr-line-dashed margin-left-40"></div>
<input type="hidden" name="storage.type" value="qiniu">
<div class="layui-form-item text-center padding-left-40">
<input type="hidden" name="storage.type" value="qiniu">
<button class="layui-btn" type="submit">保存配置</button>
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消修改吗?" data-close>取消修改</button>
</div>