cuiqian2004
2024-08-16 c54802aead926ec66f2c1263ce1615aee0623728
pages/login/index.vue
@@ -48,7 +48,7 @@
         <!-- 输入框示例 -->
         <uni-popup ref="inputDialog" type="dialog">
            <uni-popup-dialog ref="inputClose" mode="input" :title="translateSys('set')" :value="userServer"
               placeholder="请输入内容" @confirm="dialogInputConfirm"></uni-popup-dialog>
               :placeholder="translate('input_server')" @confirm="dialogInputConfirm"></uni-popup-dialog>
         </uni-popup>
         <!-- 版本升级弹窗开始 -->
         <uni-popup ref="promotion" type="center">
@@ -144,9 +144,13 @@
            }
            var ser = this.userServer.toLowerCase().split('/');
            var translateSyshis = this;
            if (ser[1] == 'mobox3') { //判断当前网址是否是mobox3
               var url = 'http://' + this.userServer + '/Program/version.txt';
               // console.log(url);
            var rootUrl = 'http://' + this.userServer
            if (this.userServer.includes("://")) {
               rootUrl = this.userServer
            }
            if (ser[ser.length - 1] == 'mobox3') { //判断当前网址是否是mobox3
               var url = rootUrl + '/Program/version.txt';
               console.log(url);
               uni.request({
                  url: url, // 指定JS文件的完整路径
                  method: 'GET',
@@ -160,8 +164,8 @@
                        var VersionCode = versionInfo[2].replace(".apk", "").replace(".", "").replace(
                           ".", ""); //服务端版本号
                        // this.downloadUrl = resp.PdaUrl+"/"+VersionName; //app下载链接
                        translateSyshis.downloadUrl = "http://" + translateSyshis.userServer +
                           "/Program/" +
                        translateSyshis.downloadUrl = rootUrl + "/Program/" +
                           VersionName; //app下载链接this.
                        var isver = translateSyshis.compare(versionNum, version);
                        if (isver) {
@@ -193,7 +197,7 @@
               });
            } else {
               var dataInfo = {
                  server: this.userServer
                  server: rootUrl
               };
               this.$store.dispatch('GetApkVersionInfo', dataInfo).then(success => {
                  console.log(success);
@@ -208,7 +212,7 @@
                        const VersionCode = resp.VersionCode; //版本编码
                        const versionNum = resp.Version; //服务端版本号
                        // this.downloadUrl = resp.PdaUrl+"/"+VersionName; //app下载链接
                        translateSyshis.downloadUrl = "http://" + translateSyshis.userServer +
                        translateSyshis.downloadUrl = rootUrl +
                           "/Program/" +
                           VersionName; //app下载链接this.
                        var isver = translateSyshis.compare(versionNum, version);
@@ -330,7 +334,17 @@
         //    actionLogin:'login'
         // }),
         inputDialogToggle() {
            this.$refs.inputDialog.open()
            // this.$refs.inputDialog.open()
            const $this = this
            uni.navigateTo({
               url: "./set",
               events: {
                  exitSetEvent(val) {
                      $this.userServer = val;
                      $this.query(); //版本升级
                  }
               }
            })
         },
         clickSetLanguage() {
            uni.navigateTo({
@@ -411,9 +425,18 @@
               });
               return;
            }
            var rootUrl = 'http://' + this.userServer
            if (this.userServer.includes("://")) {
               rootUrl = this.userServer
            }
            const mobox3Port = utils.session.getValue('mobox3_port');
            //检查 "登录状态/锁屏状态" 结束
            var loginInfo = {
               server: this.userServer,
               server: rootUrl,
               orgsport: mobox3Port?.org || 5101,
               moboxsport: mobox3Port?.mobox || 5102,
               datasport: mobox3Port?.data || 5103,
               mongodbsport: mobox3Port?.mongodb || 5201,
               uname: this.userName,
               pwd: this.userPwd,
               cname: plus.device.model,
@@ -483,6 +506,9 @@
         var url = this.$store.state.url;
         var username = this.$store.state.username;
         var userpwd = this.$store.state.userpwd;
         var ischecked = false;
         if (!this.userServer)
            this.userServer = url;