index.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <script src="axios.min.js"></script>
  8. <script src="cordova.js"></script>
  9. <title>绿洲宇宙</title>
  10. </head>
  11. <body>
  12. <script>
  13. let flag = new URLSearchParams(location.search).get('flag') || localStorage.getItem('flag');
  14. function padding(s, num) {
  15. return ('00000000000000' + s).slice(-num);
  16. }
  17. let date = new Date();
  18. let dateFlag = date.getFullYear() + padding(date.getMonth() + 1, 2) + padding(date.getDate(), 2);
  19. dateFlag = new Date().getTime();
  20. if (flag === '1') {
  21. console.log('set flag 1');
  22. localStorage.setItem('flag', flag);
  23. location.href = 'https://www.raex.vip';
  24. }
  25. var version = '1.0.2';
  26. var iosCFBundleVersion = '169';
  27. var androidVersionCode = '1189';
  28. document.addEventListener('deviceready', function () {
  29. axios.get('https://www.raex.vip/appVersion/getVersion?version=' + version + '&platform=' + cordova.platformId)
  30. .then(function (res) {
  31. if (res.data.review) {
  32. if ('ios' === cordova.platformId) {
  33. location.href = 'https://ios.raex.vip?review=true&dateFlag=' + dateFlag;
  34. } else {
  35. location.href = 'https://www.raex.vip?review=true&dateFlag=' + dateFlag;
  36. }
  37. } else {
  38. location.href = 'https://www.raex.vip?dateFlag=' + dateFlag;
  39. }
  40. })
  41. .catch(function (e) {
  42. location.href = 'https://www.raex.vip?dateFlag=' + dateFlag;
  43. });
  44. });
  45. </script>
  46. </body>
  47. </html>