storage-qiniu.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <form onsubmit="return false" data-auto="true" action="{:sysuri()}" method="post" class='layui-form layui-card' autocomplete="off">
  2. <div class="layui-card-body padding-top-20">
  3. <div class="color-text margin-left-40 margin-bottom-20 layui-code text-center layui-bg-gray" style="border-left-width:1px">
  4. <p class="margin-bottom-5 font-w7">文件将上传到七牛云存储,对象存储需要配置为公开访问的 Bucket 空间</p>
  5. 完成实名认证后可获得 10G 免费存储空间哦!<a target="_blank" href="https://portal.qiniu.com/signup?code=1hefnmobzees2">我要免费申请</a>
  6. </div>
  7. {include file='config/storage-0'}
  8. <div class="layui-form-item">
  9. <label class="layui-form-label label-required">
  10. <span class="color-green font-w7">访问协议</span><br><span class="nowrap color-desc">Protocol</span>
  11. </label>
  12. <div class="layui-input-block">
  13. {if !sysconf('storage.qiniu_http_protocol')}{php}sysconf('storage.qiniu_http_protocol','http');{/php}{/if}
  14. {foreach ['http'=>'HTTP','https'=>'HTTPS','auto'=>"AUTO"] as $protocol=>$remark}
  15. <label class="think-radio">
  16. {if sysconf('storage.qiniu_http_protocol') eq $protocol}
  17. <input checked type="radio" name="storage.qiniu_http_protocol" value="{$protocol}" lay-ignore> {$remark}
  18. {else}
  19. <input type="radio" name="storage.qiniu_http_protocol" value="{$protocol}" lay-ignore> {$remark}
  20. {/if}
  21. </label>
  22. {/foreach}
  23. <p class="help-block">七牛云存储访问协议,其中 HTTPS 需要配置证书才能使用( AUTO 为相对协议 )</p>
  24. </div>
  25. </div>
  26. <div class="layui-form-item">
  27. <label class="layui-form-label">
  28. <span class="color-green font-w7">存储区域</span><br><span class="nowrap color-desc label-required">Region</span>
  29. </label>
  30. <div class="layui-input-block">
  31. {foreach ['华东','华北','华南','北美'] as $area}
  32. <label class="think-radio">
  33. {if sysconf('storage.qiniu_region') eq $area}
  34. <input checked type="radio" name="storage.qiniu_region" value="{$area}" lay-ignore> {$area}
  35. {else}
  36. <input type="radio" name="storage.qiniu_region" value="{$area}" lay-ignore> {$area}
  37. {/if}
  38. </label>
  39. {/foreach}
  40. <p class="help-block">七牛云存储空间所在区域,需要严格对应储存所在区域才能上传文件</p>
  41. </div>
  42. </div>
  43. <div class="layui-form-item">
  44. <label class="layui-form-label" for="storage.qiniu_bucket">
  45. <span class="color-green font-w7">空间名称</span><br><span class="nowrap color-desc">Bucket</span>
  46. </label>
  47. <div class="layui-input-block">
  48. <input id="storage.qiniu_bucket" type="text" name="storage.qiniu_bucket" required value="{:sysconf('storage.qiniu_bucket')}" placeholder="请输入七牛云存储 Bucket (空间名称)" class="layui-input">
  49. <p class="help-block">填写七牛云存储空间名称,如:static</p>
  50. </div>
  51. </div>
  52. <div class="layui-form-item">
  53. <label class="layui-form-label" for="storage.qiniu_http_domain">
  54. <span class="color-green font-w7">访问域名</span><br><span class="nowrap color-desc">Domain</span>
  55. </label>
  56. <div class="layui-input-block">
  57. <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">
  58. <p class="help-block">填写七牛云存储访问域名,如:static.thinkadmin.top</p>
  59. </div>
  60. </div>
  61. <div class="layui-form-item">
  62. <label class="layui-form-label" for="storage.qiniu_access_key">
  63. <span class="color-green font-w7">访问密钥</span><br><span class="nowrap color-desc">AccessKey</span>
  64. </label>
  65. <div class="layui-input-block">
  66. <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">
  67. <p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到访问密钥</p>
  68. </div>
  69. </div>
  70. <div class="layui-form-item">
  71. <label class="layui-form-label" for="storage.qiniu_secret_key">
  72. <span class="color-green font-w7">安全密钥</span><br><span class="nowrap color-desc">SecretKey</span>
  73. </label>
  74. <div class="layui-input-block">
  75. <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">
  76. <p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到安全密钥</p>
  77. </div>
  78. </div>
  79. <div class="hr-line-dashed margin-left-40"></div>
  80. <input type="hidden" name="storage.type" value="qiniu">
  81. <div class="layui-form-item text-center padding-left-40">
  82. <button class="layui-btn" type="submit">保存配置</button>
  83. <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消修改吗?" data-close>取消修改</button>
  84. </div>
  85. </div>
  86. </form>