index.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php //$host = $_SERVER['HTTP_HOST']; /*资源路径设置*/ ?>
  2. <?php //$newVersion = time() /*时间戳*/ ?>
  3. <!doctype html>
  4. <html lang="en">
  5. <head>
  6. <title>长护险</title>
  7. <!-- <style>-->
  8. <!-- * {-->
  9. <!-- margin: 0;-->
  10. <!-- padding: 0;-->
  11. <!-- }-->
  12. <!-- </style>-->
  13. <meta charset="UTF-8">
  14. <meta name="viewport"
  15. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  16. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  17. <link href="http://<?php echo $host ?>/webapp/safety/dome/css/personal.edf9ca5c.css" rel=prefetch>
  18. <link href="http://<?php echo $host ?>/webapp/safety/dome/js/personal.3ce2282d.js" rel=prefetch>
  19. <link href="http://<?php echo $host ?>/webapp/safety/dome/css/app.d52af059.css" rel=preload as=script>
  20. <link href="http://<?php echo $host ?>/webapp/safety/dome/css/chunk-vendors.03324911.css" rel=preload as=script>
  21. <link href="http://<?php echo $host ?>/webapp/safety/dome/js/app.a2316c7e.js" rel=preload as=script>
  22. <link href="http://<?php echo $host ?>/webapp/safety/dome/js/chunk-vendors.262e0564.js" rel=preload as=script>
  23. <link href="http://<?php echo $host ?>/webapp/safety/dome/css/chunk-vendors.03324911.css" rel=stylesheet>
  24. <link href="http://<?php echo $host ?>/webapp/safety/dome/css/app.d52af059.css" rel=stylesheet>
  25. </head>
  26. <body>
  27. <!--vue-->
  28. <div id=app></div>
  29. <script src="http://<?php echo $host ?>/webapp/safety/dome/js/chunk-vendors.262e0564.js"></script>
  30. <script src="http://<?php echo $host ?>/webapp/safety/dome/js/app.a2316c7e.js"></script>
  31. </body>
  32. <!--vue-end-->
  33. <script type="text/javascript" id="wxMain" data-sign="<?php echo @htmlentities(json_encode($signPackage)); ?>"></script>
  34. <script type="text/javascript" defer>
  35. (function () {
  36. var ua = navigator.userAgent.toLowerCase();
  37. <?php
  38. // if (isset($from_channel)) {
  39. // echo "var from_channel = '$from_channel';";
  40. // if (!empty($userId2) && $from_channel == 'baidu') {
  41. // echo "var bd_userId = localStorage.setItem('bd_userId', '" . $userId2 . "');";
  42. // }
  43. // }
  44. ?>
  45. if (ua.match(/MicroMessenger/i) == 'micromessenger') {
  46. <?php
  47. if (!empty($userId2) && !empty($appToken2)) {
  48. echo '
  49. var wxUserID2 = localStorage.setItem("wxUserID2", "' . $userId2 . '");
  50. var appToken2 = localStorage.setItem("appToken2", "' . $appToken2 . '");
  51. ';
  52. }
  53. ?>
  54. var userID2 = localStorage.getItem('wxUserID2');
  55. var appToken2 = localStorage.getItem('appToken2');
  56. console.log(userID2);
  57. console.log(appToken2);
  58. var uri = location.href;
  59. if (!userID2 || !appToken2) {
  60. localStorage.clear();
  61. location.href = '<?php echo Yii::app()->request->baseUrl . 'index.php?r=ch/web/wxIndex'; ?>';
  62. }
  63. if (uri.indexOf('state=yiguanjia') > -1 && userID2 && appToken2) {
  64. window.location.href = 'http://common.yiguanjia.me/index.php?r=ch/web/index';
  65. }
  66. // document.write('<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"><\/script>');
  67. }
  68. if (location.hash == '#rd') {
  69. location.hash = '';
  70. }
  71. })();
  72. </script>
  73. </body>
  74. </html>