From 61b15082745d5f663dcd74803145e7e5d063f42f Mon Sep 17 00:00:00 2001 From: guoshuang Date: Mon, 28 Feb 2022 15:19:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?update:=E7=99=BB=E5=BD=95=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/login/index.vue | 77 ++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index 318781e..e26ea7b 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -152,43 +152,48 @@ export default class LoginPage extends BasePage { } Version = '1.0.1'; async update() { - await session.QueryVersion(); - if (this.Version < session.Version) { - // 版本更新提示 - uni.showModal({ - content: this.$t('message.Tip1') as string, - confirmText: this.$t('message.workArea_Confirm') as string, - cancelText: this.$t('message.Cancel') as string, - showCancel: false, - success: (res) => { - if (res.confirm) { - //确定执行下载 - let downloadApkUrl = session.url; - uni.showLoading({ - title: vm.$t('message.uploading') as string, - //title: '正在下载中..........', - }); - ////////////////uni下载方法, - uni.downloadFile({ - url: downloadApkUrl, - success: (downloadResult) => { - uni.hideLoading(); - if (downloadResult.statusCode == 200) { - //安装更新 - plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () { - //uni.showToast('更新成功,重启'); - plus.runtime.restart(); - }); - } - }, - }); - } else if (res.cancel) { - this.go(); - } - }, - }); - return; + try { + await session.QueryVersion(); + if (this.Version < session.Version) { + // 版本更新提示 + uni.showModal({ + content: this.$t('message.Tip1') as string, + confirmText: this.$t('message.workArea_Confirm') as string, + cancelText: this.$t('message.Cancel') as string, + showCancel: false, + success: (res) => { + if (res.confirm) { + //确定执行下载 + let downloadApkUrl = session.url; + uni.showLoading({ + title: vm.$t('message.uploading') as string, + //title: '正在下载中..........', + }); + ////////////////uni下载方法, + uni.downloadFile({ + url: downloadApkUrl, + success: (downloadResult) => { + uni.hideLoading(); + if (downloadResult.statusCode == 200) { + //安装更新 + plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () { + //uni.showToast('更新成功,重启'); + plus.runtime.restart(); + }); + } + }, + }); + } else if (res.cancel) { + this.go(); + } + }, + }); + return; + } + } catch (e) { + console.log('error', e); } + this.go(); } /////////////////无用代码无用代码 From 2c89580580ed01cc4f2bf8ca6c8aa7d2b9859a36 Mon Sep 17 00:00:00 2001 From: guoshuang Date: Mon, 28 Feb 2022 18:06:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update:=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=BA1.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/login/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index e26ea7b..b68837f 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -150,7 +150,7 @@ export default class LoginPage extends BasePage { console.log('image', this.image); console.log('Version////', this.Version); } - Version = '1.0.1'; + Version = '1.0.2'; async update() { try { await session.QueryVersion();