combine.php 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235
  1. <?php
  2. namespace app\index;
  3. class combine extends BaseUser
  4. {
  5. function initialize()
  6. {
  7. parent::initialize();
  8. }
  9. function index()
  10. {ini_set('display_errors', 1);
  11. ini_set('display_startup_errors', 1);
  12. error_reporting(E_ALL);
  13. // 获取页码参数
  14. $page = SafeRequest("page", "get");
  15. if (empty($page)) {
  16. $page = 1;
  17. }
  18. // 使用分页查询
  19. $result = db("combine")->where("userid", $this->userid)->order("id desc")->paginate(["page" => $page, 'list_rows' => 5]);
  20. $count = $result->total();
  21. $this -> action = 'apps'
  22. ?>
  23. <!DOCTYPE html>
  24. <html lang="zh-cn">
  25. <head>
  26. <meta charset="utf-8">
  27. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" />
  28. <meta name="keywords" content="<?php echo IN_KEYWORDS; ?>" />
  29. <meta name="description" content="<?php echo IN_DESCRIPTION; ?>" />
  30. <title>外部链接合并 - <?php echo IN_NAME; ?> - 免费应用内测托管平台|iOS应用Beta测试分发|Android应用内测分发</title>
  31. <?php $this->static_(); ?>
  32. </head>
  33. <body>
  34. <?php $this->header(); ?>
  35. <style>
  36. .details-top {
  37. padding: 39px 30px;
  38. }
  39. .details-top .p1{
  40. color: rgba(21, 21, 21, 1);
  41. font-family: Source Han Sans SC;
  42. font-weight: 500;
  43. font-size: 16px;
  44. line-height: 20px;
  45. }
  46. #hotApp_box {
  47. display: flex;
  48. justify-content: space-between;
  49. align-items: start;
  50. margin: 0;
  51. }
  52. .download-details {
  53. padding: 10px 30px 72px;
  54. }
  55. .flex-left {
  56. width: calc(100% - 303px);
  57. }
  58. .flex-right {
  59. width: 303px;
  60. }
  61. .qrcode_img {
  62. width: 235px;
  63. height: 235px;
  64. object-fit: cover;
  65. border: 1px solid rgba(232, 234, 236, 1);
  66. }
  67. .qrcode_img::placeholder {
  68. color: rgba(143, 149, 159, 1);
  69. font-size: 16px;
  70. line-height: 22px;
  71. }
  72. .qrcode_url_tips {
  73. font-size: 13px;
  74. line-height: 17px;
  75. margin: 10px 0;
  76. }
  77. .qrcode_url_input_box {
  78. margin-bottom: 30px;
  79. }
  80. .qrcode_url_input_box input {
  81. border: 1px solid rgba(232, 234, 236, 1);
  82. /* width: 711px; */
  83. height: 52px;
  84. line-height: 52px;
  85. border-width: 1px;
  86. padding: 0 20px;
  87. box-sizing: border-box;
  88. font-size: 14px;
  89. color: rgba(21, 21, 21, 1);
  90. }
  91. .qrcode_url_input_box input::placeholder {
  92. font-size: 14px;
  93. color: rgba(143, 149, 159, 1);
  94. }
  95. .generate_btn_box {
  96. margin-top: 50px;
  97. }
  98. .generate_qrcode_btn {
  99. background: rgba(33, 104, 251, 1);
  100. width: 120px;
  101. height: 34px;
  102. border-radius: 4px;
  103. padding-top: 7px;
  104. padding-right: 20px;
  105. padding-bottom: 7px;
  106. padding-left: 20px;
  107. color: rgba(255, 255, 255, 1);
  108. font-family: Source Han Sans SC;
  109. font-weight: 500;
  110. font-style: Medium;
  111. font-size: 16px;
  112. line-height: 20px;
  113. }
  114. #hotApp-qrcode-downBtn:active:focus,
  115. #hotApp-qrcode-downBtn:hover,
  116. .generate_qrcode_btn:active:focus,
  117. .generate_qrcode_btn:hover {
  118. background: rgba(33, 104, 251, 1);
  119. color: rgba(255, 255, 255, 1);
  120. border: unset;
  121. outline: none;
  122. }
  123. .qrcode_show_box {
  124. text-align: right;
  125. margin-bottom: 12px;
  126. margin-top: 10px;
  127. }
  128. .qrcode_url_box { margin-bottom: 20px; }
  129. .qrcode_url_tips { margin-bottom: 10px; }
  130. .os_name { font-weight: bold; color: #333; }
  131. .qrcode_url_input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
  132. /* .qrcode_function {
  133. text-align: center;
  134. }
  135. .down_btnbox {
  136. text-align: center;
  137. } */
  138. .qrcode_function {
  139. margin: 0 auto;
  140. }
  141. .down_btnbox {
  142. padding-left: 126px;
  143. }
  144. #hotApp-qrcode-downBtn {
  145. border: 1px solid rgba(33, 104, 251, 1);
  146. width: 120px;
  147. height: 34px;
  148. border-radius: 4px;
  149. padding: 0 20px;
  150. background: rgba(255, 255, 255, 1);
  151. color: rgba(33, 104, 251, 1);
  152. font-size: 16px;
  153. line-height: 34px;
  154. float: unset;
  155. margin: 0 auto;
  156. }
  157. .tab-content {
  158. display: none;
  159. }
  160. .tab-content.active {
  161. display: block;
  162. }
  163. /* 标签页样式 */
  164. .tabs {
  165. margin: 12px 0 0 0;
  166. padding: 10px 30px;
  167. }
  168. .tabs .nav-tabs {
  169. border-bottom: 0 solid #e5e5e5;
  170. /* 添加横向滚动支持 */
  171. overflow-x: auto;
  172. overflow-y: hidden;
  173. white-space: nowrap;
  174. display: flex;
  175. flex-wrap: nowrap;
  176. -webkit-overflow-scrolling: touch;
  177. /* iOS滚动优化 */
  178. scrollbar-width: none;
  179. /* Firefox隐藏滚动条 */
  180. -ms-overflow-style: none;
  181. /* IE隐藏滚动条 */
  182. }
  183. /* 隐藏Webkit浏览器的滚动条 */
  184. .tabs .nav-tabs::-webkit-scrollbar {
  185. display: none;
  186. }
  187. .tabs .nav-tabs>li>a {
  188. border: none;
  189. padding: 12px 2px;
  190. margin-right: 24px;
  191. border-radius: 0;
  192. color: rgba(143, 149, 159, 1);
  193. font-family: Source Han Sans SC;
  194. font-weight: 500;
  195. font-size: 15px;
  196. line-height: 20px;
  197. }
  198. .tabs .nav-tabs>li>a:hover {
  199. border: none;
  200. background-color: #ffffff;
  201. color: rgba(75, 132, 255, 1);
  202. }
  203. .tabs .nav-tabs>li.active>a,
  204. .tabs .nav-tabs>li.active>a:hover,
  205. .tabs .nav-tabs>li.active>a:focus {
  206. border: none;
  207. border-bottom: 2px solid rgba(75, 132, 255, 1);
  208. color: rgba(75, 132, 255, 1);
  209. font-weight: 700;
  210. }
  211. /* 记录 */
  212. .table-responsive {
  213. overflow-x: auto;
  214. border: 1px solid rgba(232, 234, 236, 1);
  215. }
  216. /* 通用表格设置 */
  217. .table {
  218. border: 1px solid #e5e5e5;
  219. margin-bottom: 0;
  220. }
  221. .table>tbody>tr>th {
  222. background: rgba(245, 246, 247, 1);
  223. height: 36px;
  224. color: rgba(143, 149, 159, 1);
  225. font-family: Source Han Sans SC;
  226. font-weight: 500;
  227. font-size: 14px;
  228. line-height: 18px;
  229. text-align: center;
  230. vertical-align: middle !important;
  231. }
  232. .table>tbody>tr>td {
  233. color: rgba(0, 0, 0, 1);
  234. box-sizing: border-box;
  235. padding: 0 15px !important;
  236. height: 68px;
  237. text-align: center;
  238. font-family: Source Han Sans SC;
  239. font-weight: 400;
  240. font-size: 14px;
  241. line-height: 13px;
  242. border-top: unset;
  243. border-bottom: 1px solid rgba(232, 234, 236, 1);
  244. vertical-align: middle !important;
  245. }
  246. .table>tfoot>tr>td {
  247. padding: 0 15px !important;
  248. vertical-align: middle !important;
  249. text-align: center;
  250. }
  251. .table>tbody>tr:hover>td {
  252. background-color: #ebf7ff;
  253. }
  254. .table>tbody>tr>td.angle-parent {
  255. color: rgba(75, 132, 255, 1);
  256. }
  257. .table>tbody>tr>td>a {
  258. color: rgba(33, 104, 251, 1);
  259. font-weight: 500;
  260. font-size: 14px;
  261. }
  262. .table>tbody>tr>td>a+a {
  263. margin-left: 14px;
  264. }
  265. /* 操作按钮 */
  266. .table .btn-detail {
  267. height: 30px;
  268. border-width: 1px;
  269. border-radius: 4px;
  270. padding-top: 5px;
  271. padding-right: 8px;
  272. padding-bottom: 5px;
  273. padding-left: 8px;
  274. color: rgba(255, 116, 41, 1);
  275. border: 1px solid rgba(255, 116, 41, 1);
  276. font-family: Source Han Sans SC;
  277. font-weight: 500;
  278. font-size: 14px;
  279. line-height: 20px;
  280. }
  281. /* 翻页 */
  282. .pagination-box {
  283. /* text-align: right; */
  284. }
  285. .pagination {
  286. margin: 10px auto 10px;
  287. }
  288. .pagination>li>a,
  289. .pagination>li>span {
  290. color: rgba(33, 104, 251, 1);
  291. }
  292. .pagination>.active>a,
  293. .pagination>.active>a:focus,
  294. .pagination>.active>a:hover,
  295. .pagination>.active>span,
  296. .pagination>.active>span:focus,
  297. .pagination>.active>span:hover {
  298. background-color: rgba(33, 104, 251, 1);
  299. border-color: rgba(33, 104, 251, 1);
  300. }
  301. .pagination>li:first-child {
  302. display: inline-block;
  303. padding: 7px 0 7px 12px;
  304. background-color: transparent !important;
  305. border: unset;
  306. color: rgba(33, 104, 251, 1);
  307. pointer-events: none;
  308. }
  309. /* 底部 */
  310. .tips {
  311. margin: 12px auto 57px;
  312. color: rgba(143, 149, 159, 1);
  313. font-size: 13px;
  314. line-height: 20px;
  315. }
  316. @media (max-width: 768px) {
  317. .release-app2>.row {
  318. margin: 0;
  319. }
  320. .app-details .details-top {
  321. padding: 0.32rem;
  322. }
  323. .details-top .p1{
  324. font-size: 0.28rem;
  325. line-height: 0.40rem;
  326. }
  327. #hotApp_box {
  328. margin: 0;
  329. display: block;
  330. }
  331. .download-details {
  332. padding: 0.20rem 0.32rem 0.60rem;
  333. }
  334. .flex-left {
  335. width: 100%;
  336. }
  337. .flex-right {
  338. width: 100%;
  339. }
  340. .qrcode_img {
  341. width: 2.66rem;
  342. height: 2.66rem;
  343. margin: 0 auto;
  344. }
  345. .qrcode_url_tips {
  346. font-size: 0.28rem;
  347. line-height: 0.34rem;
  348. margin: 0.20rem 0;
  349. }
  350. .qrcode_url_input_box {
  351. margin-bottom: 0.4rem;
  352. }
  353. .qrcode_url_input_box input {
  354. height: 0.64rem;
  355. line-height: 0.64rem;
  356. padding: 0 0.24rem;
  357. font-size: 0.28rem;
  358. }
  359. .qrcode_url_input_box input::placeholder {
  360. font-size: 0.28rem;
  361. }
  362. .generate_btn_box {
  363. margin-top: 0;
  364. }
  365. .generate_qrcode_btn {
  366. width: 100%;
  367. height: 0.68rem;
  368. border-radius: 0.08rem;
  369. font-size: 0.32rem;
  370. line-height: 0.68rem;
  371. padding: 0;
  372. }
  373. #hotApp-qrcode-downBtn:active:focus,
  374. #hotApp-qrcode-downBtn:hover,
  375. .generate_qrcode_btn:active:focus,
  376. .generate_qrcode_btn:hover {
  377. background: rgba(33, 104, 251, 1);
  378. color: rgba(255, 255, 255, 1);
  379. }
  380. .qrcode_show_box {
  381. margin-bottom: 0.2rem;
  382. margin-top: 0.48rem;
  383. text-align: center;
  384. }
  385. .qrcode_url_box { margin-bottom: 20px; }
  386. .qrcode_url_tips {margin-bottom: 0.20rem;}
  387. .qrcode_url_input {
  388. width: 100%;
  389. padding: 10px;
  390. border-radius: 4px;
  391. }
  392. .qrcode_function {
  393. margin: 0 auto;
  394. }
  395. .down_btnbox {
  396. padding-left: 0;
  397. }
  398. #hotApp-qrcode-downBtn {
  399. width: 100%;
  400. height: 0.68rem;
  401. border-radius: 0.08rem;
  402. font-size: 0.32rem;
  403. line-height: 0.68rem;
  404. }
  405. .down_qrcode_box {
  406. width: 100%;
  407. }
  408. /* 标签页样式 */
  409. .tabs {
  410. margin: 0;
  411. padding: 0 0.32rem;
  412. }
  413. .tabs .nav-tabs>li>a {
  414. padding: 0.24rem 0.04rem;
  415. margin-right: 0.48rem;
  416. font-size: 0.30rem;
  417. line-height: 0.40rem;
  418. }
  419. /* 通用表格设置 */
  420. .table {
  421. margin-bottom: 0;
  422. }
  423. .table>tbody>tr>th {
  424. height: 0.72rem;
  425. font-size: 0.28rem;
  426. line-height: 0.36rem;
  427. }
  428. .table>tbody>tr>td {
  429. padding: 0.2rem 0.30rem!important;
  430. height: 1.36rem;
  431. font-size: 0.28rem;
  432. line-height: 0.32rem;
  433. }
  434. .table>tfoot>tr>td {
  435. padding: 0 0.30rem !important;
  436. }
  437. .table>tbody>tr>td>a {
  438. font-size: 0.28rem;
  439. }
  440. .table>tbody>tr>td>a+a {
  441. margin-left: 0.28rem;
  442. }
  443. /* 操作按钮 */
  444. .table .btn-detail {
  445. height: 0.60rem;
  446. border-radius: 0.08rem;
  447. padding-top: 0.10rem;
  448. padding-right: 0.16rem;
  449. padding-bottom: 0.10rem;
  450. padding-left: 0.16rem;
  451. font-size: 0.28rem;
  452. line-height: 0.40rem;
  453. }
  454. /* 翻页 */
  455. .pagination {
  456. margin: 0.20rem auto 0.20rem;
  457. }
  458. .pagination>li:first-child {
  459. padding: 0.14rem 0 0.14rem 0.24rem;
  460. }
  461. /* 底部 */
  462. .release-app2 .warn-prompt-wrap {
  463. padding-bottom: unset;
  464. margin-top: 0;
  465. margin-bottom: 1.46rem;
  466. }
  467. .tips {
  468. margin: 0.24rem auto 0.48rem;
  469. color: rgba(143, 149, 159, 1);
  470. font-weight: 400;
  471. font-size: 0.24rem;
  472. line-height: 0.40rem;
  473. }
  474. }
  475. </style>
  476. <div class="release-app-wrap">
  477. <div class="container">
  478. <div class="release-app2">
  479. <div class="crumbs">
  480. <a href="/index/apps">我的应用</a>
  481. <span>/</span>
  482. <a href="/index/apps">应用列表</a>
  483. <span>/</span>
  484. 外部链接合并
  485. </div>
  486. <div class="row clearfix">
  487. <div class="col-sm-2">
  488. <aside class="aside-left">
  489. <ul>
  490. <li title="上传应用" class="<?php echo ($this->module == 'publish' || $this->module == 'publish_update') ? 'active' : '' ?>">
  491. <a href="/index/publish/<?php echo $this->action ?>"> <span class="iconfont icon-upload1"></span>上传应用</a>
  492. </li>
  493. <li title="应用列表" class="<?php echo $this->module == 'apps' ? 'active' : '' ?>">
  494. <a href="/index/apps/<?php echo $this->action ?>"><span class="iconfont icon-41"></span>应用列表</a>
  495. </li>
  496. <li title="绑定域名" class="<?php echo $this->module == 'domain' ? 'active' : '' ?>">
  497. <a href="/index/domain/<?php echo $this->action ?>"><span class="iconfont icon-liulanqi"></span>绑定域名</a>
  498. </li>
  499. <li title="外部链接合并" class="<?php echo $this->module == 'combine' ? 'active' : '' ?>">
  500. <a href="/index/combine/<?php echo $this->action ?>"><span class="iconfont icon-erweima"></span>外部链接合并</a>
  501. </li>
  502. <!-- <li title="合并记录" class="<?php echo $this->module == 'jilu' ? 'active' : '' ?>">
  503. <a href="/index/jilu/<?php echo $this->action ?>"><span class="iconfont icon-jilu"></span>合并记录</a>
  504. </li> -->
  505. </ul>
  506. </aside>
  507. </div>
  508. <div class="col-sm-10">
  509. <div class="aside-right">
  510. <div class="app-details app-details2">
  511. <div class="details-top clearfix">
  512. <b class="p1">外部链接合并</b>
  513. <div class="p1">
  514. 设置提示:本功能可将外部的ios链接或安卓链接,来和本站的链接进行合并到一起使用,
  515. <br class="hidden-xs">
  516. 以便更好的管理不同平台链接的使用,可生成二维码和短链接。
  517. </div>
  518. </div>
  519. <div style="height: 10px; background: rgb(242, 242, 245)"></div>
  520. <div class="tabs">
  521. <ul class="nav nav-tabs" role="tablist">
  522. <li role="presentation" class="active">
  523. <a href="?tab=combine" aria-controls="tab-combine" role="tab">链接合并</a>
  524. </li>
  525. <li role="presentation" class="">
  526. <a href="?tab=record" aria-controls="tab-record" role="tab">合并记录</a>
  527. </li>
  528. </ul>
  529. </div>
  530. <div class="download-details">
  531. <!-- 链接合并表单 -->
  532. <div id="tab-combine" class="generate_qrcode_box tab-content <?php echo (SafeRequest("tab", "get") != 'record') ? 'active' : ''; ?>">
  533. <div class="row" id="hotApp_box">
  534. <div class="flex-left">
  535. <div class="qrcode_url_box">
  536. <div class="qrcode_url_tips">
  537. <b class="os_name">iOS系统</b>
  538. </div>
  539. <div class="qrcode_url_input_box">
  540. <input type="text" placeholder="请输入苹果应用下载地址" id="ios_url" class="form-control qrcode_url_input">
  541. </div>
  542. </div>
  543. <div class="qrcode_url_box">
  544. <div class="qrcode_url_tips">
  545. <b class="os_name">安卓系统</b>
  546. </div>
  547. <div class="qrcode_url_input_box">
  548. <input type="text" id="android_url" class="form-control qrcode_url_input" placeholder="请输入安卓系统应用下载地址">
  549. </div>
  550. </div>
  551. <div class="qrcode_url_box" id="shortUrlha" style="display:none">
  552. <div class="qrcode_url_tips">
  553. <b class="os_name">短连接地址</b>
  554. </div>
  555. <div class="qrcode_url_input_box">
  556. <input type="text" id="shortUrlh" class="form-control qrcode_url_input" placeholder="">
  557. </div>
  558. </div>
  559. <div class="alert alert-success" style="display: none;">
  560. <span class="txt"></span>
  561. </div>
  562. <div class="alert alert-danger" style="display: none;">
  563. <span class="txt"></span>
  564. </div>
  565. <div class="generate_btn_box">
  566. <a class="btn generate_qrcode_btn">
  567. 生成二维码
  568. </a>
  569. </div>
  570. </div>
  571. <div class="flex-right">
  572. <div class="qrcode_show_box">
  573. <img class="qrcode_img hidden-xs" src="/img/qrcode_no.png">
  574. <img class="qrcode_img visible-xs" src="/img/qrcode_no_m.png">
  575. </div>
  576. <div class="qrcode_function clearfix row">
  577. <input type="hidden" name="" class="qrcode_key" value="">
  578. <input type="hidden" name="" class="shortUrl" value="">
  579. <input type="hidden" name="download_url" id="download_url" value="<?php echo $_SERVER['HTTP_HOST']; ?>/index/combine/download?qrcode_path=">
  580. <input type="hidden" name="more_down_url" id="more_down_url" value="<?php echo $_SERVER['HTTP_HOST']; ?>/index/combine/downloadQrCode?qrcode_path=">
  581. <input type="hidden" name="" class="qrcode_path" value="">
  582. <div class="down_btnbox">
  583. <div class="btn-group down_qrcode_box">
  584. <a href="javascript:qrcodeDown();" style="width:100%" class="btn btn-default down_qrcode_btn" id="hotApp-qrcode-downBtn" data-downurl="" >下载二维码</a>
  585. </div>
  586. </div>
  587. </div>
  588. </div>
  589. </div>
  590. </div>
  591. <!-- 合并记录表格 -->
  592. <div id="tab-record" class="tab-content <?php echo (SafeRequest("tab", "get") == 'record') ? 'active' : ''; ?>">
  593. <div class="table-responsive">
  594. <table class="table">
  595. <tbody>
  596. <tr>
  597. <th>ID</th>
  598. <th>安卓地址</th>
  599. <th>IOS地址</th>
  600. <th>短链接</th>
  601. <th>添加时间</th>
  602. <th>操作</th>
  603. </tr>
  604. <?php if(!empty($result) && $count > 0): ?>
  605. <?php foreach($result as $item): ?>
  606. <tr>
  607. <td><div><?php echo $item['id']; ?></div></td>
  608. <td><div><?php echo htmlspecialchars($item['android']); ?></div></td>
  609. <td><div><?php echo htmlspecialchars($item['ios']); ?></div></td>
  610. <td><div><?php echo htmlspecialchars($item['link']); ?></div></td>
  611. <td><div style="min-width: 135px;"><?php echo date('Y-m-d H:i:s', $item['ctime']); ?></div></td>
  612. <td>
  613. <!-- <div><a href="<?php echo $item['link']; ?>" target="_blank" class="btn-detail">查看</a></div> -->
  614. <div><a href="#" style="color: #FF7429;border-color:#FF7429" class="btn-del app-bloder-btn" data-id="<?php echo htmlspecialchars($item['id']); ?>">删除</a></div>
  615. </td>
  616. </tr>
  617. <?php endforeach; ?>
  618. <?php else: ?>
  619. <tr>
  620. <td colspan="6" class="text-center">暂无记录</td>
  621. </tr>
  622. <?php endif; ?>
  623. </tbody>
  624. </table>
  625. <!-- <?php
  626. if ($count == 0) {
  627. ?>
  628. <div class="text-center no-content">
  629. <img src="/static/index/image/invoice-1.png" alt="">
  630. <p class="color-333 mt10">
  631. 暂无任何数据
  632. </p>
  633. </div>
  634. <?php
  635. }
  636. ?> -->
  637. </div>
  638. <div class="pagination-box">
  639. <?php echo getRender($result, $page); ?>
  640. </div>
  641. </div>
  642. </div>
  643. </div>
  644. </div>
  645. </div>
  646. </div>
  647. <div class="warn-prompt-wrap clearfix">
  648. <dl class="clearfix fr warn-prompt-1 tips">
  649. <!-- <dd> -->
  650. 提示:请您确认您合并的二维码,符合
  651. 《<a href="/index/about/specification" target="_blank" class="color-hover">审核规范</a>》,如违反规范,APP将做删除处理,屡次合并二维码将被封禁账号。
  652. <br>根据最新审核规范,不接受如下APP在平台进行合并二维码:色情类、直播类、金融类、区块链虚拟币等。如已合并,将做删除处理。
  653. <!-- </dd> -->
  654. </dl>
  655. </div>
  656. </div>
  657. </div>
  658. </div>
  659. </div>
  660. <script>
  661. // 页面加载时清理不必要的cookie
  662. $(document).ready(function() {
  663. console.log('页面加载完成!');
  664. cleanUnnecessaryCookies();
  665. // 检查jQuery是否加载
  666. if (typeof $ !== 'undefined') {
  667. console.log('jQuery已加载');
  668. } else {
  669. console.log('jQuery未加载!');
  670. }
  671. // 检查按钮是否存在
  672. if ($('#hotApp_box .generate_qrcode_btn').length > 0) {
  673. console.log('生成二维码按钮已找到');
  674. } else {
  675. console.log('生成二维码按钮未找到!');
  676. }
  677. // Tab切换功能
  678. $('.nav-tabs a').on('click', function(e) {
  679. e.preventDefault();
  680. var target = $(this).attr('href').replace('?tab=', '');
  681. // 获取当前URL参数
  682. var currentUrl = new URL(window.location);
  683. var currentPage = currentUrl.searchParams.get('page');
  684. // 构建新的URL
  685. var newUrl = '/index/combine/index';
  686. if (target === 'record') {
  687. newUrl += '?tab=record';
  688. if (currentPage) {
  689. newUrl += '&page=' + currentPage;
  690. }
  691. } else {
  692. newUrl += '?tab=combine';
  693. }
  694. // 跳转到新URL
  695. window.location.href = newUrl;
  696. });
  697. // 根据URL参数设置初始tab状态
  698. var urlParams = new URLSearchParams(window.location.search);
  699. var tabParam = urlParams.get('tab');
  700. if (tabParam === 'record') {
  701. $('.nav-tabs li').removeClass('active');
  702. $('.nav-tabs a[href="?tab=record"]').parent().addClass('active');
  703. $('.tab-content').removeClass('active');
  704. $('#tab-record').addClass('active');
  705. } else {
  706. $('.nav-tabs li').removeClass('active');
  707. $('.nav-tabs a[href="?tab=combine"]').parent().addClass('active');
  708. $('.tab-content').removeClass('active');
  709. $('#tab-combine').addClass('active');
  710. }
  711. });
  712. function qrcodeDown() {
  713. var qrcode_path = $('.qrcode_path').val();
  714. if (qrcode_path == '') {
  715. alert("请先生成二维码!");
  716. return false;
  717. } else {
  718. window.open(qrcode_path);
  719. }
  720. }
  721. // 绑定生成二维码按钮事件
  722. $('#hotApp_box .generate_qrcode_btn').on('click', function() {
  723. console.log('按钮被点击了!');
  724. var $btn = $(this);
  725. var ios_url = $('#ios_url').val();
  726. var android_url = $('#android_url').val();
  727. console.log('iOS URL:', ios_url);
  728. console.log('Android URL:', android_url);
  729. $btn.button('loading');
  730. if(!ios_url){
  731. alert('请输入IOS地址');
  732. $btn.button('reset');
  733. return false;
  734. }
  735. if(!android_url){
  736. alert('请输入安卓地址');
  737. $btn.button('reset');
  738. return false;
  739. }
  740. // 清理不必要的cookie
  741. cleanUnnecessaryCookies();
  742. console.log('开始发送AJAX请求...');
  743. $.ajax({
  744. type: "POST",
  745. url: "/index/combine/down",
  746. data: "ios_url=" + encodeURIComponent(ios_url) + "&android_url=" + encodeURIComponent(android_url),
  747. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  748. headers: {
  749. "X-Requested-With": "XMLHttpRequest",
  750. "Accept": "application/json, text/javascript, */*; q=0.01"
  751. },
  752. success: function(ret) {
  753. console.log('AJAX成功响应:', ret);
  754. $btn.button('reset');
  755. if (ret.status == 1) {
  756. $('.qrcode_img').attr("src", ret.qrcode_path);
  757. $('#shortUrlh').val(ret.shortUrl);
  758. $('#shortUrlha').show();
  759. $('.qrcode_path').val(ret.qrcode_path);
  760. $('.shortUrl').val(ret.shortUrl);
  761. } else {
  762. alert(ret.msg || '生成失败!');
  763. }
  764. },
  765. error: function(err) {
  766. console.log('AJAX错误:', err);
  767. $btn.button('reset');
  768. alert('请求失败,请重试!');
  769. }
  770. });
  771. });
  772. function cleanUnnecessaryCookies() {
  773. // 定义需要保留的cookie
  774. var keepCookies = ['PHPSESSID', 'in_userid', 'in_username', 'in_userpassword'];
  775. // 获取所有cookie
  776. var cookies = document.cookie.split(';');
  777. // 清理不必要的cookie
  778. for (var i = 0; i < cookies.length; i++) {
  779. var cookie = cookies[i].trim();
  780. var cookieName = cookie.split('=')[0];
  781. // 如果cookie不在保留列表中,则删除
  782. if (keepCookies.indexOf(cookieName) === -1) {
  783. document.cookie = cookieName + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
  784. console.log('已删除cookie: ' + cookieName);
  785. }
  786. }
  787. }
  788. $('.btn-del').click(function(){
  789. var id = $(this).attr('data-id');
  790. $.ajax({
  791. type: "POST",
  792. url: "/index/combine/del",
  793. data: {
  794. id: id
  795. },
  796. dataType: "json",
  797. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  798. headers: {
  799. "X-Requested-With": "XMLHttpRequest",
  800. "Accept": "application/json, text/javascript, */*; q=0.01"
  801. },
  802. success: function(ret) {
  803. console.log('AJAX成功响应:', ret);
  804. if(ret.status == 'error'){
  805. alert('删除失败');
  806. return
  807. }
  808. alert('删除成功');
  809. setTimeout(function(){
  810. window.location.reload();
  811. }, 2000);
  812. // window.location.reload();
  813. },
  814. error: function(err) {
  815. console.log('AJAX错误:', err);
  816. $btn.button('reset');
  817. alert('请求失败,请重试!');
  818. }
  819. });
  820. });
  821. </script>
  822. <?php $this->footer(); ?>
  823. </body>
  824. </html>
  825. <?php
  826. }
  827. function del(){
  828. $id = SafeRequest("id", "post");
  829. if(empty($id)){
  830. echo json_encode(array("status"=>"error","msg"=>"参数错误"));die;
  831. }
  832. $res = db("combine")->where("userid", $this->userid)->where('id', $id)->delete();
  833. if(!$res){
  834. echo json_encode(array("status"=>"error","msg"=>"删除失败"));die;
  835. }
  836. echo json_encode(array("status"=>"success","msg"=>"删除成功"));
  837. }
  838. function down()
  839. {
  840. // 生产环境应该关闭错误显示
  841. if (defined('ENVIRONMENT') && ENVIRONMENT === 'production') {
  842. ini_set('display_errors', 0);
  843. ini_set('display_startup_errors', 0);
  844. error_reporting(0);
  845. } else {
  846. ini_set('display_errors', 1);
  847. ini_set('display_startup_errors', 1);
  848. error_reporting(E_ALL);
  849. }
  850. error_log("=== down() 方法开始执行 ===");
  851. // 设置session配置
  852. if (!session_id()) {
  853. session_set_cookie_params(0, '/', '', false, true);
  854. session_start();
  855. }
  856. // 设置AJAX响应头
  857. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  858. header("Cache-Control: no-store, no-cache, must-revalidate");
  859. header("Pragma: no-cache");
  860. header("Content-type: application/json; charset=utf-8");
  861. error_log("响应头已设置");
  862. // 检查用户登录状态
  863. error_log("检查用户登录状态: " . ($this->userlogined ? "已登录" : "未登录"));
  864. if (!$this->userlogined) {
  865. error_log("用户未登录,返回错误");
  866. $response = [
  867. "qrcode_path" => "",
  868. "status" => 0,
  869. "msg" => "请先登录后再操作!",
  870. "shortUrl" => ""
  871. ];
  872. echo json_encode($response);
  873. exit;
  874. }
  875. $_var_3 = SafeRequest("ios_url");
  876. $_var_4 = SafeRequest("android_url");
  877. error_log("接收到的参数 - ios_url: " . $_var_3 . ", android_url: " . $_var_4);
  878. if (!$_var_3) {
  879. $response = [
  880. "qrcode_path" => "",
  881. "status" => 0,
  882. "msg" => "请输入iOS地址!",
  883. "shortUrl" => ""
  884. ];
  885. echo json_encode($response);
  886. exit;
  887. }
  888. if (!$_var_4) {
  889. $response = [
  890. "qrcode_path" => "",
  891. "status" => 0,
  892. "msg" => "请输入Android地址!",
  893. "shortUrl" => ""
  894. ];
  895. echo json_encode($response);
  896. exit;
  897. }
  898. // 验证URL格式和安全性
  899. if (!$this->isValidUrl($_var_3)) {
  900. $response = [
  901. "qrcode_path" => "",
  902. "status" => 0,
  903. "msg" => "iOS地址格式无效!",
  904. "shortUrl" => ""
  905. ];
  906. echo json_encode($response);
  907. exit;
  908. }
  909. if (!$this->isValidUrl($_var_4)) {
  910. $response = [
  911. "qrcode_path" => "",
  912. "status" => 0,
  913. "msg" => "Android地址格式无效!",
  914. "shortUrl" => ""
  915. ];
  916. echo json_encode($response);
  917. exit;
  918. }
  919. // 生成短链接
  920. $_var_5 = $this->generateShortUrl();
  921. error_log("生成的短链接: " . $_var_5);
  922. // 生成短链接URL
  923. $short_url = "http://" . $_SERVER['HTTP_HOST'] . "/" . $_var_5;
  924. error_log("生成的短链接URL: " . $short_url);
  925. // 生成二维码图片路径
  926. $qrcode_url = "http://" . $_SERVER['HTTP_HOST'] . "/qrcode?link=" . urlencode($short_url);
  927. error_log("生成的二维码URL: " . $qrcode_url);
  928. // 保存到数据库 - 按照指定格式
  929. $insert_data = [
  930. "userid" => $this->userid,
  931. "username" => $this->username,
  932. "android" => $_var_4, // android字段存储android_url
  933. "ios" => $_var_3, // ios字段存储ios_url
  934. "link" => $short_url, // link字段存储短链接URL
  935. "short" => $_var_5, // short字段存储短链接标识符
  936. "ctime" => time()
  937. ];
  938. error_log("插入数据: " . json_encode($insert_data));
  939. try {
  940. $_var_7 = db("combine")->insertGetId($insert_data);
  941. error_log("数据库插入结果: " . $_var_7);
  942. } catch (Exception $e) {
  943. error_log("数据库错误: " . $e->getMessage());
  944. $response = [
  945. "qrcode_path" => "",
  946. "status" => 0,
  947. "msg" => "数据库操作失败,请稍后重试!",
  948. "shortUrl" => ""
  949. ];
  950. echo json_encode($response);
  951. exit;
  952. }
  953. if ($_var_7) {
  954. // 使用新的返回格式
  955. $response = [
  956. "qrcode_path" => $qrcode_url,
  957. "status" => 1,
  958. "msg" => "success",
  959. "shortUrl" => $short_url // 返回完整的短链接URL
  960. ];
  961. error_log("成功响应: " . json_encode($response));
  962. echo json_encode($response);
  963. } else {
  964. $response = [
  965. "qrcode_path" => "",
  966. "status" => 0,
  967. "msg" => "生成失败!",
  968. "shortUrl" => ""
  969. ];
  970. error_log("失败响应: " . json_encode($response));
  971. echo json_encode($response);
  972. }
  973. error_log("=== down() 方法执行完成 ===");
  974. exit;
  975. }
  976. function download()
  977. {
  978. $_var_8 = SafeRequest("qrcode_path");
  979. if (!$_var_8) {
  980. reJSON("参数错误!", 404);
  981. }
  982. // 修复路径遍历漏洞
  983. $qrcode_path = $_var_8;
  984. // 验证路径格式,只允许字母数字和基本符号
  985. if (!preg_match('/^[a-zA-Z0-9\/\-_\.]+$/', $qrcode_path)) {
  986. reJSON("无效的文件路径!", 403);
  987. }
  988. // 确保路径在允许的目录内
  989. $allowed_dirs = ['/uploads/qrcode/', '/qrcode/'];
  990. $is_allowed = false;
  991. foreach ($allowed_dirs as $dir) {
  992. if (strpos($qrcode_path, $dir) === 0) {
  993. $is_allowed = true;
  994. break;
  995. }
  996. }
  997. if (!$is_allowed) {
  998. reJSON("访问被拒绝!", 403);
  999. }
  1000. $file_path = $_SERVER['DOCUMENT_ROOT'] . $qrcode_path;
  1001. // 防止目录遍历
  1002. $real_path = realpath($file_path);
  1003. $doc_root = realpath($_SERVER['DOCUMENT_ROOT']);
  1004. if ($real_path === false || strpos($real_path, $doc_root) !== 0) {
  1005. reJSON("文件不存在!", 404);
  1006. }
  1007. if (file_exists($file_path)) {
  1008. // 验证文件类型
  1009. $finfo = finfo_open(FILEINFO_MIME_TYPE);
  1010. $mime_type = finfo_file($finfo, $file_path);
  1011. finfo_close($finfo);
  1012. if ($mime_type !== 'image/png' && $mime_type !== 'image/jpeg' && $mime_type !== 'image/gif') {
  1013. reJSON("不支持的文件类型!", 403);
  1014. }
  1015. header('Content-Type: ' . $mime_type);
  1016. header('Content-Disposition: attachment; filename="qrcode.png"');
  1017. readfile($file_path);
  1018. exit;
  1019. } else {
  1020. reJSON("文件不存在!", 404);
  1021. }
  1022. }
  1023. private function generateShortUrl()
  1024. {
  1025. $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  1026. $short_url = '';
  1027. // 使用更安全的随机数生成方法
  1028. if (function_exists('random_bytes')) {
  1029. $random_bytes = random_bytes(6);
  1030. for ($i = 0; $i < 6; $i++) {
  1031. $short_url .= $chars[ord($random_bytes[$i]) % strlen($chars)];
  1032. }
  1033. } elseif (function_exists('openssl_random_pseudo_bytes')) {
  1034. $random_bytes = openssl_random_pseudo_bytes(6);
  1035. for ($i = 0; $i < 6; $i++) {
  1036. $short_url .= $chars[ord($random_bytes[$i]) % strlen($chars)];
  1037. }
  1038. } else {
  1039. // 降级到rand(),但增加熵
  1040. for ($i = 0; $i < 6; $i++) {
  1041. $short_url .= $chars[rand(0, strlen($chars) - 1)];
  1042. }
  1043. }
  1044. return $short_url; // 只返回短链接标识符,不包含域名
  1045. }
  1046. private function generateQrcodeImage($url)
  1047. {
  1048. $qrcode_path = '/uploads/qrcode/' . md5($url) . '.png';
  1049. return $qrcode_path;
  1050. }
  1051. private function isValidUrl($url)
  1052. {
  1053. // 基本URL格式验证
  1054. if (!filter_var($url, FILTER_VALIDATE_URL)) {
  1055. return false;
  1056. }
  1057. // 解析URL
  1058. $parsed_url = parse_url($url);
  1059. if (!$parsed_url || !isset($parsed_url['scheme']) || !isset($parsed_url['host'])) {
  1060. return false;
  1061. }
  1062. // 只允许HTTP和HTTPS协议
  1063. if (!in_array($parsed_url['scheme'], ['http', 'https'])) {
  1064. return false;
  1065. }
  1066. // 检查是否为私有IP地址(防止SSRF)
  1067. $host = $parsed_url['host'];
  1068. $ip = gethostbyname($host);
  1069. if ($ip && $ip !== $host) {
  1070. // 检查是否为私有IP
  1071. if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
  1072. // 这是公网IP,允许
  1073. } else {
  1074. // 这是私有IP或保留IP,拒绝
  1075. return false;
  1076. }
  1077. }
  1078. // 检查URL长度限制
  1079. if (strlen($url) > 2048) {
  1080. return false;
  1081. }
  1082. return true;
  1083. }
  1084. }