cuiqian2004
2024-06-27 81162e054b22d912acef0452841be8185c810ba2
pages/login/index.vue
@@ -308,12 +308,14 @@
                           console.log('当前已是最新版本')
                        }
                     } else {
                        uni.showModal({
                           title: "提示",
                           content: '请求失败:'+ err,
                           showCancel: false,
                           confirmText: "取消"
                        });
                        // if(res.statusCode === 404){
                        //    uni.showModal({
                        //       title: "提示",
                        //       content: '请求失败,找不到更新包版本文档:'+url,
                        //       showCancel: false,
                        //       confirmText: "取消"
                        //    });
                        // }
                     }
                  },
                  fail(err) {
@@ -598,6 +600,29 @@
         }
      },
      onLoad() {
         //获取mac地址
         var net = plus.android.importClass("java.net.NetworkInterface");
         var wl0 = net.getByName('wlan0');
         var macByte = wl0.getHardwareAddress();
         var deviceId = ''
         //下面这段代码来自网络
         for (var i = 0; i < macByte.length; i++) {
             var tmp = "";
             var num = macByte[i];
             if (num < 0) {
               tmp =(255+num+1).toString(16);
             } else {
               tmp = num.toString(16);
             }
             if (tmp.length == 1) {
               tmp = "0" + tmp;
             }
             deviceId += tmp;
         }
         //78b8d67511ca
         this.$store.commit("setDeviceId", deviceId);
         console.log('Android设备的deviceId:',  deviceId);
         plus.runtime.getProperty(plus.runtime.appid, (info) => {
            // console.log(info);
            this.$data.version = info.version;