x 5 rokov pred
rodič
commit
3a7295808d
1 zmenil súbory, kde vykonal 33 pridanie a 27 odobranie
  1. 33 27
      src/views/home/Index.vue

+ 33 - 27
src/views/home/Index.vue

@@ -918,35 +918,41 @@ export default {
   },
   methods: {
     checkUpdate() {
-			var that = this;
-      if (typeof(cordova) == "undefined") {
+      const that = this;
+      if (typeof cordova == "undefined") {
         return;
-      }
-			
-      axios.get("http://qndownload.shotshock.shop/version?ts=" + Date.parse(new Date())).then(res => {
-        var ver = res.data.version
-        var url = res.data.download
-        console.log(JSON.stringify(res.data))
-				console.log(navigator.platform)
-        cordova.getAppVersion.getVersionNumber().then(version => {
-          console.log("current version: " + version);
-          console.log("remote  version: " + ver);
-          if (ver > version) {
-            console.log("current need update !");
-            that.$dialog.confirm({
-							mes: "检查到有新版本,点击确定去下载!", 
-							title: "更新提示",
-							opts: () => {
-								cordova.InAppBrowser.open(url, "_system")
-							}
-						});
-          } else {
-            console.log("current alreay is latest !");
-          }
+      }
+
+      axios
+        .get(
+          "http://qndownload.shotshock.shop/version?ts=" +
+            Date.parse(new Date())
+        )
+        .then(res => {
+          var ver = res.data.version;
+          var url = res.data.download;
+          console.log(JSON.stringify(res.data));
+          console.log(navigator.platform);
+          cordova.getAppVersion.getVersionNumber().then(version => {
+            console.log("current version: " + version);
+            console.log("remote  version: " + ver);
+            if (ver > version) {
+              console.log("current need update !");
+              that.$dialog.confirm({
+                mes: "检查到有新版本,点击确定去下载!",
+                title: "更新提示",
+                opts: () => {
+                  cordova.InAppBrowser.open(url, "_system");
+                }
+              });
+            } else {
+              console.log("current alreay is latest !");
+            }
+          });
+        })
+        .catch(err => {
+          // that.$dialog.error("检查更新失败!")
         });
-      }).catch(err => {
-        // that.$dialog.error("检查更新失败!")
-      });
     },
 
     updateVIP() {