From 6adc544527e9c2155767c6c60e4a7b900f819035 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Mon, 3 Apr 2023 15:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/request.js | 5 +- pages/home/login.vue | 113 ++++++++++++++++++++++++++++++++++++++++-- pages/home/my.vue | 114 ------------------------------------------- 3 files changed, 110 insertions(+), 122 deletions(-) diff --git a/common/request.js b/common/request.js index 065a7d5..a708ade 100644 --- a/common/request.js +++ b/common/request.js @@ -5,8 +5,7 @@ export function host(host='default',suffix='/plant_manage'){ // default:`http://i5skii.natappfree.cc` //陈 // default:`http://jjytvc.natappfree.cc` //马 // default:`http://6exd5b.natappfree.cc` //何 - default:`http://192.168.0.116:8080` //孙 - // default:"http://192.168.0.14:7000" + default:"http://192.168.0.14:7000" }:{ default:`` } @@ -65,7 +64,7 @@ const request=async function(url,param={}){ } },600) if(res){ - if(res.data.code==401){ + if(res.data.code==401&&!param.skipToken){ store.commit('outLogin') return{statu:false, msg:"登录超时!"} } diff --git a/pages/home/login.vue b/pages/home/login.vue index e6e4d79..e7cfd32 100644 --- a/pages/home/login.vue +++ b/pages/home/login.vue @@ -56,6 +56,32 @@ 还没有账号?立即注册 + + + + + + \ No newline at end of file diff --git a/pages/home/my.vue b/pages/home/my.vue index e44d4fc..95786f2 100644 --- a/pages/home/my.vue +++ b/pages/home/my.vue @@ -79,38 +79,10 @@ 系统消息 {{$store.state.sysMsgNum}} - - 检测更新 {{appVersion}} - 退出 - - - - - @@ -120,18 +92,6 @@ import request,{host} from '@/common/request' data(){ return{ host, - appVersion:"", - appDownLoadUrl:"", - isShowModal:false, - modalOptions:{ - isShowCancel:true, - isDownApp:false, - modalContent:"请升级app到最新版本!", - process:0, - modalTitle:"监测到有新版本", - okText:"立刻升级", - asyncClose:true, - }, } }, onLoad(options){ @@ -140,12 +100,6 @@ import request,{host} from '@/common/request' uni.navigateTo({url:`/pages/purchase/${options.toPage}`}) } }) - - //#ifdef APP-PLUS - plus.runtime.getProperty(plus.runtime.appid, async info=>{ - this.appVersion = info.version - }) - //#endif }, onShow(){ this.$store.commit("setSysMsgShow",false) @@ -168,74 +122,6 @@ import request,{host} from '@/common/request' } }) }, - async getVersion(){ - var res=await request("/appVersion/plantAppVersion/getAppVersion") - if(res.statu){ - if(res.data.appVersion!=this.appVersion){ - this.isShowModal=true - this.appDownLoadUrl=res.data.appDownloadUrl - }else{ - uni.showModal({ - title:"提示", - content:"当前版本已是最新版本!", - showCancel:false, - }) - } - }else{ - uni.showModal({ - title:"提示", - content:res.msg||"获取版本号失败!", - showCancel:false, - }) - } - }, - //下载最新app - upgrade(){ - //#ifdef APP-PLUS - if(this.modalOptions.isShowCancel){ - this.modalOptions.modalTitle="开始下载" - this.modalOptions.isDownApp=true - this.modalOptions.isShowCancel=false - var dtask=plus.downloader.createDownload(this.appDownLoadUrl,{ - filename: "_downloads/", - timeout:30, - retry:1 - },(d,status)=>{ - this.modalOptions.isDownApp=false - this.modalOptions.asyncClose=false - this.modalOptions.okText="确认" - this.$refs.modal.clearLoading() - if(status == 200){ - plus.runtime.install(d.filename,{force:true},()=>plus.runtime.restart(), e=>{ - this.modalOptions.modalTitle="提示" - this.modalOptions.modalContent="安装升级包失败!" - }) - }else{ - this.modalOptions.modalTitle="提示" - this.modalOptions.modalContent="下载升级包失败!" - } - }) - console.log(dtask,'--dtask---') - if(dtask){ - dtask.addEventListener("statechanged",e=>{ - if(e&&e.totalSize>0){ - // console.log("state",e.state,"::::","--------statechanged-----------",e.downloadedSize) - this.modalOptions.process=Math.floor((e.downloadedSize/e.totalSize)*10000)/100 - } - },false) - dtask.start(); - }else{ - this.isShowModal=false - this.modalOptions=this.$options.data().modalOptions - uni.showModal({ - title:"提示", - content:"下载最新版本失败!", - showCancel:false, - }) - } - } - //#endif - }, }, } \ No newline at end of file