pages/login/index.vue
@@ -283,47 +283,94 @@
               });
               return;
            }
            var dataInfo = {
               server: this.userServer
            };
            this.$store.dispatch('GetApkVersionInfo', dataInfo).then(success => {
               console.log(success);
               if (success.code == '00000') {
                  let resp = success.data;
                  if (resp) {
                     // const obj = resp.data.filter(item => {
                     //    return item.groupName == 'version'
                     // })
                     //获取当前版本号
                     const VersionName = resp.VersionName; //更新包名称
                     const VersionCode = resp.VersionCode; //版本编码
                     const versionNum = resp.Version; //服务端版本号
                     // this.downloadUrl = resp.PdaUrl+"/"+VersionName; //app下载链接
                     this.downloadUrl = "http://" + this.userServer + "/Program/" + VersionName; //app下载链接this.
                     var isver = this.compare(versionNum,version);
                     if (isver) {
                        this.$refs.promotion.open();
            var ser = this.userServer.split('/');
            var $this = this;
            if(ser[1] == 'mobox3'){ //判断当前网址是否是mobox3
               var url = 'http://'+this.userServer+'/Program/version.txt';
               // console.log(url);
               uni.request({
                  url: url, // 指定JS文件的完整路径
                  method: 'GET',
                  success(res) {
                     console.log(res);
                     if (res && res.statusCode === 200) {
                        //获取当前版本号
                        var VersionName = res.data; //更新包名称
                        var versionInfo = res.data.split('_');
                        var versionNum = versionInfo[2].replace(".apk", ""); //版本编码
                        var VersionCode = versionInfo[2].replace(".apk", "").replace(".", "").replace(".", ""); //服务端版本号
                        // this.downloadUrl = resp.PdaUrl+"/"+VersionName; //app下载链接
                        $this.downloadUrl = "http://" + $this.userServer + "/Program/" + VersionName; //app下载链接this.
                        var isver = $this.compare(versionNum,version);
                        if (isver) {
                           $this.$refs.promotion.open();
                        } else {
                           console.log('当前已是最新版本')
                        }
                     } else {
                        console.log('当前已是最新版本')
                        // if(res.statusCode === 404){
                        //    uni.showModal({
                        //       title: "提示",
                        //       content: '请求失败,找不到更新包版本文档:'+url,
                        //       showCancel: false,
                        //       confirmText: "取消"
                        //    });
                        // }
                     }
                  },
                  fail(err) {
                     // 错误处理逻辑
                     uni.showModal({
                        title: "错误",
                        content: '获取'+url+'文件失败:'+ err,
                        showCancel: false,
                        confirmText: "取消"
                     });
                  }
               } else {
               });
            }else{
               var dataInfo = {
                  server: this.userServer
               };
               this.$store.dispatch('GetApkVersionInfo', dataInfo).then(success => {
                  console.log(success);
                  if (success.code == '00000') {
                     let resp = success.data;
                     if (resp) {
                        // const obj = resp.data.filter(item => {
                        //    return item.groupName == 'version'
                        // })
                        //获取当前版本号
                        const VersionName = resp.VersionName; //更新包名称
                        const VersionCode = resp.VersionCode; //版本编码
                        const versionNum = resp.Version; //服务端版本号
                        // this.downloadUrl = resp.PdaUrl+"/"+VersionName; //app下载链接
                        $this.downloadUrl = "http://" + $this.userServer + "/Program/" + VersionName; //app下载链接this.
                        var isver = $this.compare(versionNum,version);
                        if (isver) {
                           $this.$refs.promotion.open();
                        } else {
                           console.log('当前已是最新版本')
                        }
                     }
                  } else {
                     uni.showModal({
                        title: "错误",
                        content: success.msg,
                        showCancel: false,
                        confirmText: "取消"
                     });
                  }
               }).catch(ex => {
                  console.log(ex);
                  uni.showModal({
                     title: "错误",
                     content: success.msg,
                     content: ex.errMsg ? ex.errMsg : ex.message,
                     showCancel: false,
                     confirmText: "取消"
                  });
               }
            }).catch(ex => {
               console.log(ex);
               uni.showModal({
                  title: "错误",
                  content: ex.errMsg ? ex.errMsg : ex.message,
                  showCancel: false,
                  confirmText: "取消"
               });
            });
            }
         },
         compare(curV, reqV) {
            var arr1 = curV.toString().split('.');
@@ -507,7 +554,7 @@
            //登录
            this.$store.dispatch('login', loginInfo).then(success => {
               console.log(success);
               if (success.code == '00000') {
               if (success.code == '00000' || success.err_code==0) {
                  //登录成功后清空缓存数据
                  this.$store.commit("areaFunc", null);
                  this.$store.commit("classAttrList", null);