webview_transfer.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. namespace app\index;
  4. header('Cache-Control:no-cache,must-revalidate');
  5. header('Pragma:no-cache');
  6. class webview_transfer extends Base
  7. {
  8. function index()
  9. {
  10. $id = is_numeric($this->action) ? $this->action : ($this->action && $this->action != 'index' ? bees_decrypt($this->action) : 0);
  11. if ($id) {
  12. $data = db('app_pack')->where('id', $id)->find();
  13. }
  14. if (!$id || !$data) {
  15. $this->error_message('应用不存在,或已停用');
  16. }
  17. if ($data['period'] > 0 && $data['period'] < time()) {
  18. $this->error_message('应用已过期');
  19. }
  20. $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
  21. $ios13 = strstr($ua, 'iphone os 13') || strstr($ua, 'iphone os 14');
  22. if ($ios13 && $data['type'] == 2) {
  23. if (is_ssl()) {
  24. $url = str_replace('http://', 'https://', $data['url']);
  25. } else {
  26. $url = str_replace('https://', 'http://', $data['url']);
  27. }
  28. $this->iframe_open($url);
  29. } else {
  30. redirect($data['url']);
  31. }
  32. }
  33. function error_message($msg = '哎呦,遇到错误了')
  34. {
  35. ?> <!DOCTYPE html>
  36. <!--[if IE 8]>
  37. <html lang="" class="ie8"><![endif]-->
  38. <!--[if IE 9]>
  39. <html lang="" class="ie9"><![endif]-->
  40. <!--[if !IE]><!-->
  41. <html lang="">
  42. <!--<![endif]-->
  43. <head>
  44. <title>哎呦,遇到错误了</title>
  45. <meta charset="utf-8"/>
  46. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  47. <meta name="keywords" content="apk,android,ipa,ios,iphone,ipad,app封装,应用分发,企业签名">
  48. <meta name="description" content="<?php echo IN_NAME;?>为各行业提供ios企业签名、app封装、应用分发托管服务!">
  49. <meta name="author" content="<?php echo $_SERVER['HTTP_HOST'];?>">
  50. <meta name="apple-mobile-web-app-capable" content="yes">
  51. <meta name="apple-mobile-web-app-title" content="">
  52. <meta name="baidu-site-verification" content="ukBKOPYfE2"/>
  53. <meta name="baidu-site-verification" content="xSBa81fLpH"/>
  54. <meta name="author" content="<?php echo $_SERVER['HTTP_HOST'];?>">
  55. <meta property="og:type" content="webpage">
  56. <meta property="og:title" content="<?php echo $_SERVER['HTTP_HOST'];?>">
  57. <meta property="og:image" content="<?php echo $_SERVER['HTTP_HOST'];?>/img/logo.png">
  58. <meta property="og:description" content="<?php echo IN_NAME;?>为开发者提供简洁迅速的内测程序服务">
  59. <meta name="apple-mobile-web-app-capable" content="yes">
  60. <meta name="apple-mobile-web-app-title" content="flper">
  61. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  62. <meta name="viewport"
  63. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no minimal-ui">
  64. <link rel="stylesheet" href="/static/pack/bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
  65. <link rel="stylesheet" href="/static/index/css/style.css"/>
  66. <style>
  67. body {
  68. background-color: #efeff1;
  69. }
  70. .violations {
  71. margin: 100px auto 70px;
  72. width: 524px;
  73. }
  74. .violations .bg {
  75. background: url("/static/index/image/warning.png?20180927?20190530");
  76. width: 524px;
  77. height: 505px;
  78. color: #999;
  79. font-size: 18px;
  80. text-align: center;
  81. padding: 205px 100px 0 80px;
  82. font-weight: 600;
  83. }
  84. .violations a {
  85. width: 170px;
  86. height: 40px;
  87. line-height: 40px;
  88. background-color: #ffae5e;
  89. border-radius: 20px;
  90. display: block;
  91. margin: 70px auto 0;
  92. text-align: center;
  93. color: #fff;
  94. text-decoration: none;
  95. }
  96. @media (max-width: 767px) {
  97. .violations {
  98. margin: 150px auto 0;
  99. width: 6.5rem;
  100. }
  101. .violations .bg {
  102. background: url("/static/index/image/warning1.png?201809271?20190530");
  103. background-size: cover;
  104. width: 6.5rem;
  105. height: 6.26rem;
  106. color: #999;
  107. font-size: .32rem;
  108. text-align: center;
  109. padding: 115px 60px 0 50px;
  110. font-weight: 600;
  111. }
  112. }
  113. </style>
  114. </head>
  115. <body>
  116. <div class="violations">
  117. <div class="bg"><span class="error-msg"><?php echo $msg;?></span></div>
  118. <!-- <a href="/" class="hidden-xs">{{BACK_HOME}}</a>-->
  119. </div>
  120. <script src="/static/index/js/jquery.min.js"></script>
  121. <script>
  122. var windowWidth = $(window).width();
  123. function setRem() {
  124. var windowWidth = $(window).width();
  125. if (windowWidth <= 750) {
  126. var fs = windowWidth / 750 * 6.25 * 100;
  127. $('html').css('font-size', fs + '%'); // 1rem = 100px;
  128. }
  129. };
  130. setRem();
  131. $(window).resize(setRem);
  132. console.log('APP_DOWNLOAD_TIMES_OVER[-100071]');
  133. </script>
  134. </body>
  135. <!--<script src="/static/index/js/markup.js"></script>-->
  136. <!--<script src="/static/index/js/publish/ua-parser.min.js"></script>-->
  137. <!--<script src="/static/index/js/template/wave.js"></script>-->
  138. </html>
  139. <?php
  140. exit;
  141. }
  142. function iframe_open($url)
  143. {
  144. ?> <!DOCTYPE html>
  145. <html lang="">
  146. <head>
  147. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  148. <title></title>
  149. <meta name="viewport"
  150. content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
  151. <style type="text/css">
  152. body {
  153. border: 0;
  154. margin: 0;
  155. padding: 0;
  156. height: 100vh;
  157. width: 100%;
  158. background: #fff;
  159. overflow: hidden;
  160. }
  161. </style>
  162. </head>
  163. <body>
  164. <script>
  165. if (("standalone" in window.navigator) && window.navigator.standalone) {
  166. var iframe = document.createElement("iframe");
  167. document.body.appendChild(iframe);
  168. iframe.src = "<?php echo $url;?>";
  169. iframe.height = document.body.scrollHeight;
  170. iframe.width = document.body.scrollWidth;
  171. iframe.style.overflow = "hidden";
  172. iframe.style.border = "none";
  173. iframe.style.position = "absolute";
  174. iframe.style.right = "0";
  175. iframe.style.top = "0";
  176. iframe.style.bottom = "0";
  177. document.body.style.height = document.body.scrollHeight;
  178. document.body.style.width = document.body.scrollWidth;
  179. document.body.style.border = "0";
  180. document.body.style.margin = "0";
  181. document.body.style.padding = "0";
  182. document.body.style.background = "#fff";
  183. document.body.style.overflow = "hidden";
  184. } else {
  185. location.href = "<?php echo $url;?>";
  186. }
  187. </script>
  188. </body>
  189. </html>
  190. <?php
  191. }
  192. }