From a4b95f039ae59662454df8a7541b270006c515c1 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期三, 22 三月 2023 17:02:01 +0800 Subject: [PATCH] # --- pages/login/login.vue | 24 +++++++++++------------- 1 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index 69d3dfb..8c7adf8 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -235,7 +235,6 @@ let that = this; uni.getSystemInfo({ success: (res) => { - console.log(res.platform); if (res.platform == "android") { that.AndroidCheckUpdate(); } @@ -247,24 +246,20 @@ let that = this; plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => { that.version = wgtinfo.version //瀹㈡埛绔増鏈彿 - console.log('褰撳墠app鐗堟湰淇℃伅锛�' + that.version); }) setTimeout(()=>{ that.getUpdateVersion() - },1000) + },100) }, // 鏍¢獙鐗堟湰 getUpdateVersion() { - console.log(this.version); let that = this let type = 0 if (that.baseUrl == 'http://undefined:undefined/undefined') { return } - console.log(2); let url = that.baseUrl + '/appVersion/checkUpdate/' + that.version + '/' + type - console.log(url); uni.request({ url: url, method: 'GET', @@ -289,21 +284,17 @@ downWgt() { let that = this; const downloadUrl = that.baseUrl + "/appVersion/downloadApp/" + that.filename - console.log(downloadUrl); uni.showLoading({ title: '鏇存柊涓�︹��' }) - console.log('*************************************'); const downloadTask = uni.downloadFile({ //鎵ц涓嬭浇 url: downloadUrl, //涓嬭浇鍦板潃 timeout: 1000 * 30, //30绉掕秴鏃舵椂闂� success: downloadResult => { //涓嬭浇鎴愬姛 console.log(downloadResult); - // that.showdownLine = false + that.showdownLine = false uni.hideLoading(); - console.log('downloadResult.statusCode' + downloadResult.statusCode) if (downloadResult.statusCode == 200) { - console.log('鏇存柊涓�') uni.showModal({ title: '', content: '鏇存柊鎴愬姛锛岀‘瀹氱幇鍦ㄩ噸鍚悧锛�', @@ -323,15 +314,22 @@ } } }); + } else { + uni.hideLoading(); + that.showdownLine = false + uni.showToast({ + title:'璇峰厛涓婁紶瀹夎鍖�', + icon: 'error' + }) } }, fail: err => { uni.hideLoading(); that.showdownLine = false - that.$u.toast(err.errMsg) - console.log(err) + that.$u.toast(downloadResult.errMsg) }, complete: com => { + console.log(com) } }); -- Gitblit v1.9.1