Sin descripción
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.htm 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. {include file="header.htm" /}
  2. <body style="background-color: #FFF; overflow: auto;">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page">
  7. {include file="bar.htm" /}
  8. <!-- 操作说明 -->
  9. <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%;">
  10. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  11. <h4 title="提示相关设置操作时应注意的要点">提示</h4>
  12. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  13. </div>
  14. <ul>
  15. <li>
  16. 1、先【<a href="https://portal.qiniu.com/signup" target="_blank">注册申请</a>】七牛云账号,请将在【<a href="https://portal.qiniu.com/user/key" target="_blank">密钥管理</a>】中查看到的AK和SK分别填入对应的AccessKey和SecretKey。
  17. </li>
  18. <li>
  19. 2、初次使用时,只需填入正确的AccessKey、SecretKey,七牛云自动分配存储空间名和临时访问域名!
  20. </li>
  21. <li>
  22. 3、临时访问域名(有效期30天),建议在七牛云那边解析自己的图片访问域名,并替换这里的访问域名,以免造成后期图片访问不了!
  23. </li>
  24. <li style="color: red;">
  25. 4、注意:修改存储空间名或访问域名,将会导致之前上传的加速图片自动变为本地路径,新上传的图片可继续加速。如果切换回之前的空间或域名即可加速之前的图片,不建议频繁切换。
  26. </li>
  27. </ul>
  28. </div>
  29. <form class="form-horizontal" id="post_form" action="" method="post">
  30. <div class="ncap-form-default">
  31. <dl class="row">
  32. <dt class="tit">
  33. <label for="access_key"><em>*</em>AccessKey</label>
  34. </dt>
  35. <dd class="opt">
  36. <input type="text" name="access_key" placeholder="" value="{$Qiniuyun.access_key}" id="access_key" class="input-txt">
  37. <span class="err"></span>
  38. <p class="notic"></p>
  39. </dd>
  40. </dl>
  41. <dl class="row">
  42. <dt class="tit">
  43. <label for="secret_key"><em>*</em>SecretKey</label>
  44. </dt>
  45. <dd class="opt">
  46. <input type="text" name="secret_key" placeholder="" value="{$Qiniuyun.secret_key}" id="secret_key" class="input-txt">
  47. <span class="err"></span>
  48. <p class="notic"></p>
  49. </dd>
  50. </dl>
  51. {notempty name="$Qiniuyun.bucket"}
  52. <input type="hidden" name="is_bucket" value="1">
  53. <dl class="row">
  54. <dt class="tit">
  55. <label for="bucket"><em>*</em>存储空间名</label>
  56. </dt>
  57. <dd class="opt">
  58. <select name="bucket" id="bucket" onchange="SelectDomain()">
  59. {volist name='$ListBucket' id='vo'}
  60. <option value="{$vo}" {eq name="$vo" value="$Qiniuyun.bucket"} selected {/eq}>{$vo}</option>
  61. {/volist}
  62. </select>
  63. <span style="color: red;"></span>
  64. <p class="notic">要修改此项,请先到七牛云创建存储空间名,再选择对应的存储空间名。</p>
  65. </dd>
  66. </dl>
  67. <input type="hidden" name="is_domain" value="1">
  68. <dl class="row">
  69. <dt class="tit">
  70. <label for="domain"><em>*</em>访问域名</label>
  71. </dt>
  72. <dd class="opt">
  73. <select name="domain" id="domain">
  74. {volist name='$ListDomain' id='vo'}
  75. <option value="{$vo}" {eq name="$vo" value="$Qiniuyun.domain"} selected {/eq}>{$vo}</option>
  76. {/volist}
  77. </select>
  78. <span style="color: red;"></span>
  79. <p class="notic">要修改此项,请先到七牛云绑定域名等待生效后,再选择对应七牛云中已保存的外链默认域名。</p>
  80. </dd>
  81. </dl>
  82. <dl class="row">
  83. <dt class="tit">
  84. <label for="tcp"><em>*</em>域名协议</label>
  85. </dt>
  86. <dd class="opt">
  87. <select name="tcp" id="tcp">
  88. <option value="3" {eq name="$Qiniuyun.tcp" value="3"} selected {/eq}>请选择…</option>
  89. <option value="1" {eq name="$Qiniuyun.tcp" value="1"} selected {/eq}>http://</option>
  90. <option value="2" {eq name="$Qiniuyun.tcp" value="2"} selected {/eq}>https://</option>
  91. </select>
  92. <span style="color: red;"></span>
  93. <p class="notic"></p>
  94. </dd>
  95. </dl>
  96. {/notempty}
  97. <dl class="row {lt name='$version' value='v1.4.9'} none {/lt}">
  98. <dt class="tit">
  99. <label for="local">本地同步保存</label>
  100. </dt>
  101. <dd class="opt">
  102. <label class="curpoin"><input id="local_save1" name="local_save" value="0" type="radio" {if condition='empty($Qiniuyun.local_save)'}checked="checked"{/if}>启用</label>
  103. &nbsp;
  104. <label class="curpoin"><input id="local_save0" name="local_save" value="1" type="radio" {if condition='!empty($Qiniuyun.local_save)'}checked="checked"{/if}>关闭</label>
  105. <p class="notic"></p>
  106. </dd>
  107. </dl>
  108. <div class="bot">
  109. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  110. </div>
  111. </div>
  112. </form>
  113. </div>
  114. <script type="text/javascript">
  115. $(function(){
  116. $('.tab-base li').click(function(){
  117. var index = $(this).index();
  118. $(this).children('a.tab').addClass('current');
  119. $(this).siblings('li').children('a.tab').removeClass('current');
  120. $('.ncap-form-default').eq(index).show().siblings().hide();
  121. })
  122. });
  123. // 查询选中的存储空间名对应的访问域名
  124. function SelectDomain(){
  125. layer_loading('正在获取访问域名');
  126. $.ajax({
  127. url: "{:weapp_url('Qiniuyun/Qiniuyun/select_domain')}",
  128. data: $('#post_form').serialize(),
  129. type:'post',
  130. dataType:'json',
  131. success:function(res){
  132. layer.closeAll();
  133. if ('1' == res.code) {
  134. // $('#domain').val(res.data);
  135. $('#domain').empty().html(res.data);
  136. }else{
  137. layer.alert(res.msg, {icon:0});
  138. }
  139. }
  140. });
  141. }
  142. // 判断输入框是否为空
  143. function checkForm(){
  144. if($('input[name=access_key]').val() == ''){
  145. showErrorMsg('AccessKey不可为空!');
  146. $('input[name=access_key]').focus();
  147. return false;
  148. }
  149. if($('input[name=secret_key]').val() == ''){
  150. showErrorMsg('secretKey不可为空!');
  151. $('input[name=secret_key]').focus();
  152. return false;
  153. }
  154. {notempty name="$Qiniuyun.bucket"}
  155. if($('input[name=tcp]').val() == ''){
  156. showErrorMsg('请选择域名协议');
  157. $('input[name=tcp]').focus();
  158. return false;
  159. }
  160. {/notempty}
  161. layer_loading('正在处理');
  162. $.ajax({
  163. url: "{:weapp_url('Qiniuyun/Qiniuyun/index')}",
  164. data: $('#post_form').serialize(),
  165. type:'post',
  166. dataType:'json',
  167. success:function(res){
  168. layer.closeAll();
  169. if ('1' == res.code) {
  170. layer.msg(res.msg, {time: 2000},function(){
  171. window.location.reload();
  172. });
  173. }else{
  174. layer.alert(res.msg, {icon:0});
  175. }
  176. }
  177. });
  178. }
  179. </script>
  180. {include file="footer.htm" /}