xiongzhu 4 年之前
父節點
當前提交
a62cfb93a5
共有 3 個文件被更改,包括 33 次插入15 次删除
  1. 1 1
      config.xml
  2. 17 8
      www/index.html
  3. 15 6
      www/template.html

+ 1 - 1
config.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<widget id="vip.raex.nft" version="1.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" ios-CFBundleVersion="109" android-versionCode="112">
+<widget id="vip.raex.nft" version="1.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" ios-CFBundleVersion="110" android-versionCode="1115">
 	<name>绿洲宇宙</name>
 	<description>
         A sample Apache Cordova application that responds to the deviceready event.

+ 17 - 8
www/index.html

@@ -12,14 +12,23 @@
 <body>
     <script>
         var version = '1.0.1';
-        var iosCFBundleVersion = '108';
-        var androidVersionCode = '112';
-        axios.get('https://www.raex.vip/appVersion/checkIosReview?version=' + version).then(res => {
-            alert(JSON.stringify(res.data));
-            if (res.data.review) {
-                location.href = 'https://ios.raex.vip?review=true';
-            }
-        });
+        var iosCFBundleVersion = '110';
+        var androidVersionCode = '1114';
+        if (/iphone|ipod|ipad/.test(navigator.userAgent)) {
+            axios.get('https://www.raex.vip/appVersion/checkIosReview?version=' + version)
+                .then(function (res) {
+                    if (res.data.review) {
+                        location.href = 'https://ios.raex.vip?review=true';
+                    } else {
+                        location.href = 'https://www.raex.vip';
+                    }
+                })
+                .catch(function () {
+                    location.href = 'https://www.raex.vip';
+                });
+        } else {
+            location.href = 'https://www.raex.vip';
+        }
     </script>
 </body>
 

+ 15 - 6
www/template.html

@@ -14,12 +14,21 @@
         var version = '${version}';
         var iosCFBundleVersion = '${iosCFBundleVersion}';
         var androidVersionCode = '${androidVersionCode}';
-        axios.get('https://www.raex.vip/appVersion/checkIosReview?version=' + version).then(res => {
-            alert(JSON.stringify(res.data));
-            if (res.data.review) {
-                location.href = 'https://ios.raex.vip?review=true';
-            }
-        });
+        if (/iphone|ipod|ipad/.test(navigator.userAgent)) {
+            axios.get('https://www.raex.vip/appVersion/checkIosReview?version=' + version)
+                .then(function (res) {
+                    if (res.data.review) {
+                        location.href = 'https://ios.raex.vip?review=true';
+                    } else {
+                        location.href = 'https://www.raex.vip';
+                    }
+                })
+                .catch(function () {
+                    location.href = 'https://www.raex.vip';
+                });
+        } else {
+            location.href = 'https://www.raex.vip';
+        }
     </script>
 </body>