index.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. </head>
  45. <body layadmin-themealias="default">
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">附件设置</span></div>
  49. <div class="layui-card-body" style="padding:15px;">
  50. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">远程附件</label>
  53. <div class="layui-input-block attclass">
  54. <label class='radio-inline'>
  55. <input type='radio' name='parameter[attachment_type]' value='0' <?php if( empty($data) || $data['attachment_type'] ==0){ ?>checked <?php } ?> title="关闭" />
  56. </label>
  57. <label class='radio-inline'>
  58. <input type='radio' name='parameter[attachment_type]' value='1' <?php if(!empty($data) && $data['attachment_type'] ==1){ ?>checked <?php } ?> title="七牛云存储" />
  59. </label>
  60. <label class='radio-inline'>
  61. <input type='radio' name='parameter[attachment_type]' value='2' <?php if(!empty($data) && $data['attachment_type'] ==2){ ?>checked <?php } ?> title="阿里云OSS" />
  62. </label>
  63. <label class='radio-inline'>
  64. <input type='radio' name='parameter[attachment_type]' value='3' <?php if(!empty($data) && $data['attachment_type'] ==3){ ?>checked <?php } ?> title="腾讯云" />
  65. </label>
  66. </div>
  67. </div>
  68. <div class="row qiniu_row" style="<?php if(!empty($data) && $data['attachment_type'] ==1){ ?> <?php }else{ ?> display:none;<?php } ?>">
  69. <div class="layui-form-item qiniu_class">
  70. <label class="layui-form-label"></label>
  71. <div class="layui-input-block">
  72. <div class="summary_box">
  73. <div class="summary_lg">
  74. 启用七牛云存储后,请把/Uploads目录(包括此目录)下的子文件及子目录上传至七牛云存储 :
  75. <p><a href="https://portal.qiniu.com/signin" target="_blank">七牛云存储</a></p>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="layui-form-item qiniu_class">
  81. <label class="layui-form-label">Accesskey</label>
  82. <div class="layui-input-block">
  83. <input type="text" name="parameter[qiniu_accesskey]" class="form-control" value="{$data['qiniu_accesskey']}" />
  84. <span class='help-block'>用于签名的公钥</span>
  85. </div>
  86. </div>
  87. <div class="layui-form-item qiniu_class">
  88. <label class="layui-form-label">Secretkey</label>
  89. <div class="layui-input-block">
  90. <input type="text" name="parameter[qiniu_secretkey]" class="form-control" value="{$data['qiniu_secretkey']}" />
  91. <span class='help-block'>用于签名的私钥</span>
  92. </div>
  93. </div>
  94. <div class="layui-form-item qiniu_class">
  95. <label class="layui-form-label">Bucket</label>
  96. <div class="layui-input-block">
  97. <input type="text" name="parameter[qiniu_bucket]" class="form-control" value="{$data['qiniu_bucket']}" />
  98. <span class='help-block'>请保证bucket为可公共读取的</span>
  99. </div>
  100. </div>
  101. <div class="layui-form-item qiniu_class">
  102. <label class="layui-form-label">Url</label>
  103. <div class="layui-input-block">
  104. <input type="text" name="parameter[qiniu_url]" class="form-control" value="{$data['qiniu_url']}" />
  105. <span class='help-block'>七牛支持用户自定义访问域名。注:url开头加http://或https://结尾加 ‘/’例:http://abc.com/</span>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="row alioss_row" style="<?php if(!empty($data) && $data['attachment_type'] ==2){ ?> <?php }else{ ?> display:none;<?php } ?>">
  110. <div class="layui-form-item">
  111. <label class="layui-form-label"></label>
  112. <div class="layui-input-block">
  113. <div class="summary_box">
  114. <div class="summary_lg">
  115. <p>启用阿里oss后,请把/Uploads目录(包括此目录)下的子文件及子目录上传至阿里云oss, 相关工具:</p>
  116. <p><a href="http://bbs.aliyun.com/read/247023.html?spm=5176.383663.9.29.faitxp" target="_blank">官方推荐工具</a></p>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <div class="layui-form-item">
  122. <label class="layui-form-label">Access Key ID</label>
  123. <div class="layui-input-block">
  124. <input type="text" name="parameter[alioss_key]" class="form-control" value="{$data['alioss_key']}" />
  125. <span class='help-block'>Access Key ID是您访问阿里云API的密钥,具有该账户完全的权限,请您妥善保管。</span>
  126. </div>
  127. </div>
  128. <div class="layui-form-item">
  129. <label class="layui-form-label">Access Key Secret</label>
  130. <div class="layui-input-block">
  131. <input type="text" name="parameter[alioss_secret]" class="form-control" value="{$data['alioss_secret']}" />
  132. <span class='help-block'>Access Key Secret是您访问阿里云API的密钥,具有该账户完全的权限,请您妥善保管。(填写完Access Key ID 和 Access Key Secret 后请选择bucket)</span>
  133. </div>
  134. </div>
  135. <div class="layui-form-item qiniu_class">
  136. <label class="layui-form-label">Bucket</label>
  137. <div class="layui-input-block">
  138. <input type="text" name="parameter[alioss_bucket]" class="form-control" value="{$data['alioss_bucket']}" />
  139. <span class='help-block'>请保证bucket为可公共读取的</span>
  140. </div>
  141. </div>
  142. <div class="layui-form-item">
  143. <label class="layui-form-label">内网上传</label>
  144. <div class="layui-input-block">
  145. <label class='radio-inline'>
  146. <input type='radio' name='parameter[alioss_internal]' value='1' <?php if(!empty($data) && $data['alioss_internal'] ==1){ ?>checked <?php } ?> title="是" />
  147. </label>
  148. <label class='radio-inline'>
  149. <input type='radio' name='parameter[alioss_internal]' value='0' <?php if( empty($data) || $data['alioss_internal'] ==0){ ?>checked <?php } ?> title="否" />
  150. </label>
  151. <span class='help-block'>
  152. 如果此站点使用的是阿里云ecs服务器,并且服务器与bucket在同一地区(如:同在华北一区),您可以选择通过内网上传的方式上传附件,以加快上传速度、节省带宽。
  153. </span>
  154. </div>
  155. </div>
  156. <div class="layui-form-item">
  157. <label class="layui-form-label">自定义URL</label>
  158. <div class="layui-input-block">
  159. <input type="text" name="parameter[alioss_url]" class="form-control" value="{$data['alioss_url']}" />
  160. <span class='help-block'>
  161. 阿里云oss支持用户自定义访问域名,如果自定义了URL则用自定义的URL,如果未自定义,则用系统生成出来的URL。
  162. 注:自定义url开头加http://或https://结尾加 ‘/’例:http://abc.com/
  163. </span>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="row txyun_row" style="<?php if(!empty($data) && $data['attachment_type'] ==3){ ?> <?php }else{ ?> display:none;<?php } ?>">
  168. <div class="layui-form-item">
  169. <label class="layui-form-label"></label>
  170. <div class="layui-input-block">
  171. <div class="summary_box">
  172. <div class="summary_lg">
  173. <p>启用腾讯云存储后,请把/Uploads目录(包括此目录)下的子文件及子目录上传至腾讯云存储, 相关工具:</p>
  174. <p><a href="https://console.qcloud.com/cos/bucket" target="_blank">官方推荐工具</a></p>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <div class="layui-form-item">
  180. <label class="layui-form-label">APPID</label>
  181. <div class="layui-input-block">
  182. <input type="text" name="parameter[tx_appid]" class="form-control" value="{$data['tx_appid']}" />
  183. <span class='help-block'>APPID 是您项目的唯一ID</span>
  184. </div>
  185. </div>
  186. <div class="layui-form-item">
  187. <label class="layui-form-label">SecretID</label>
  188. <div class="layui-input-block">
  189. <input type="text" name="parameter[tx_secretid]" class="form-control" value="{$data['tx_secretid']}" />
  190. <span class='help-block'>SecretID 是您项目的安全密钥,具有该账户完全的权限,请妥善保管</span>
  191. </div>
  192. </div>
  193. <div class="layui-form-item">
  194. <label class="layui-form-label">SecretKEY</label>
  195. <div class="layui-input-block">
  196. <input type="text" name="parameter[tx_secretkey]" class="form-control" value="{$data['tx_secretkey']}" />
  197. <span class='help-block'>SecretKEY 是您项目的安全密钥,具有该账户完全的权限,请妥善保管</span>
  198. </div>
  199. </div>
  200. <div class="layui-form-item">
  201. <label class="layui-form-label">Bucket</label>
  202. <div class="layui-input-block">
  203. <input type="text" name="parameter[tx_bucket]" class="form-control" value="{$data['tx_bucket']}" />
  204. <span class='help-block'>请保证bucket为可公共读取的</span>
  205. </div>
  206. </div>
  207. <?php
  208. $tx_area_list = array(
  209. 'ap-beijing-1' => '北京一区(已售罄)',
  210. 'ap-beijing' => '北京',
  211. 'ap-shanghai' => '上海(华东)',
  212. 'ap-guangzhou' => '广州(华南)',
  213. 'ap-chengdu' => '成都(西南)',
  214. 'ap-chongqing' => '重庆',
  215. 'ap-shenzhen-fsi' => '深圳金融',
  216. 'ap-shanghai-fsi' => '上海金融',
  217. 'ap-beijing-fsi' => '北京金融',
  218. 'ap-hongkong' => '中国香港',
  219. 'ap-singapore' => '新加坡',
  220. 'ap-mumbai' => '孟买',
  221. 'ap-seoul' => '首尔',
  222. 'ap-bangkok' => '曼谷',
  223. 'ap-tokyo' => '东京',
  224. 'na-siliconvalley' => '硅谷',
  225. 'na-ashburn' => '弗吉尼亚',
  226. 'na-toronto' => '多伦多',
  227. 'eu-frankfurt' => '法兰克福',
  228. 'eu-moscow' => '莫斯科',
  229. );
  230. ?>
  231. <div class="layui-form-item">
  232. <label class="layui-form-label">地区</label>
  233. <div class="layui-input-block">
  234. <select name="parameter[tx_area]">
  235. <?php foreach($tx_area_list as $key => $val){ ?>
  236. <option value="{$key}" <?php if( !empty($data['tx_area']) && $data['tx_area'] == $key ){ ?> selected<?php } ?> >{$val}</option>
  237. <?php } ?>
  238. </select>
  239. </div>
  240. </div>
  241. <div class="layui-form-item">
  242. <label class="layui-form-label">Url</label>
  243. <div class="layui-input-block">
  244. <input type="text" name="parameter[tx_url]" class="form-control" value="{$data['tx_url']}" />
  245. <span class='help-block'>腾讯云支持用户自定义访问域名。注:url开头加http://或https://结尾加 ‘/’例:http://abc.com/</span>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="layui-form-item">
  250. <label class="layui-form-label"> </label>
  251. <div class="layui-input-block">
  252. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  253. </div>
  254. </div>
  255. </form>
  256. </div>
  257. </div>
  258. </div>
  259. <script src="/layuiadmin/layui/layui.js"></script>
  260. <script>
  261. layui.config({
  262. base: '/layuiadmin/' //静态资源所在路径
  263. }).extend({
  264. index: 'lib/index' //主入口模块
  265. }).use('index');
  266. </script>
  267. <script>
  268. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  269. var layer = layui.layer;
  270. var $;
  271. layui.use(['jquery', 'layer','form','colorpicker'], function(){
  272. $ = layui.$;
  273. var form = layui.form;
  274. var colorpicker = layui.colorpicker;
  275. //表单赋值
  276. colorpicker.render({
  277. elem: '#minicolors'
  278. ,color: '{$data['nav_bg_color']}'
  279. ,done: function(color){
  280. $('#test-colorpicker-form-input').val(color);
  281. }
  282. });
  283. colorpicker.render({
  284. elem: '#minicolors2'
  285. ,color: '{$data['index_top_font_color']}'
  286. ,done: function(color){
  287. $('#test-colorpicker-form-input2').val(color);
  288. }
  289. });
  290. //监听提交
  291. form.on('submit(formDemo)', function(data){
  292. $.ajax({
  293. url: data.form.action,
  294. type: data.form.method,
  295. data: data.field,
  296. dataType:'json',
  297. success: function (info) {
  298. if(info.status == 0)
  299. {
  300. layer.msg(info.result.message,{icon: 1,time: 2000});
  301. }else if(info.status == 1){
  302. var go_url = location.href;
  303. if( info.result.hasOwnProperty("url") )
  304. {
  305. go_url = info.result.url;
  306. }
  307. layer.msg('操作成功',{time: 1000,
  308. end:function(){
  309. location.href = info.result.url;
  310. }
  311. });
  312. }
  313. }
  314. });
  315. return false;
  316. });
  317. })
  318. </script>
  319. <script language="javascript">
  320. $('.attclass input[type=radio]').click(function(){
  321. var s_r = $(this).val();
  322. if(s_r == 0)
  323. {
  324. $('.qiniu_row').hide();
  325. $('.alioss_row').hide();
  326. $('.txyun_row').hide();
  327. }else if(s_r == 1){
  328. $('.qiniu_row').show();
  329. $('.alioss_row').hide();
  330. $('.txyun_row').hide();
  331. }else if(s_r == 2){
  332. $('.qiniu_row').hide();
  333. $('.alioss_row').show();
  334. $('.txyun_row').hide();
  335. }else if( s_r == 3 )
  336. {
  337. $('.txyun_row').show();
  338. $('.qiniu_row').hide();
  339. $('.alioss_row').hide();
  340. }
  341. })
  342. </script>
  343. </body>