#
whycq
2023-12-13 7d39b1a68266a289f66e3126473d5ebb5bd488d1
pages/login/login.vue
@@ -139,16 +139,8 @@
         if (!this.url) {
            this.url = {ip: '',port: '',project: ''}
         }
         // this.getVersion()
      },
      onShow () {
         // 手机端版本号
         // // #ifdef APP-PLUS
         // var that = this
         // plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
         //    that.version = wgtinfo.version
         // });
         // // #endif
         this.getVersion()
      },
      methods: {
@@ -176,6 +168,7 @@
            this.baseUrl = "http://" + this.url.ip + ':' + this.url.port + '/' + this.url.project
            uni.setStorageSync('baseUrl', this.baseUrl);
            uni.setStorageSync('url', this.url);
            uni.setStorageSync('project','tzsk')
            this.$refs.inputDialog.close()
         },
         onLogin() {
@@ -196,6 +189,9 @@
                  "content-type": "application/json"
               },
               success(result) {
                  uni.reLaunch({
                     url: '../home/home'
                  });
                  if (result.statusCode === 404) {
                     uni.showToast({
                        title: '登录失败',
@@ -265,11 +261,18 @@
               url: url,
               method: 'GET',
               success(res) {
                  console.log(res);
                  var res = res.data
                  if (res.data) {
                     that.filename = res.data.path
                     that.dialogContent = '发现新版本:' + res.data.version + ', 是否立即更新'
                     that.$refs.upVersion.open()
                  } else {
                     uni.showToast({
                        title: res.msg,
                        icon: "none",
                        position: 'top'
                     })
                  }
                  
               }