diff --git a/src/api/httpRequest3.js b/src/api/httpRequest3.js index 569f7345..e6714f5e 100644 --- a/src/api/httpRequest3.js +++ b/src/api/httpRequest3.js @@ -1,6 +1,9 @@ import storage from '../common/utils/storage' - +import { + removeToken +} from '@/common/utils/auth' + function service(options = {}) { var token = storage.getStorage(storage.constant.token) var tenantId = storage.getStorage('tenantId') @@ -20,7 +23,7 @@ function service(options = {}) { "dataType":"json", "tenant-id":tenantId }; - options.timeout = 10000 + options.timeout = 300000 options.url = requestUrl+options.url @@ -31,6 +34,13 @@ function service(options = {}) { if(res.data.code==0){ resolve(res.data); }else { + if(res.data.code==401){ + uni.clearStorageSync() + removeToken(); + uni.reLaunch({ + url: '/pages/login/index' + }) + } reject("系统异常:"+res.data.msg) console.log("系统异常",res.data.msg) } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 10bc33c0..ac9170fa 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -156,24 +156,27 @@ }, onShow() { if (uni.getStorageSync("hasLogin") == null || uni.getStorageSync("hasLogin") == false) { - uni.showModal({ - title: '未登录', - content: '您未登录 , 需要登录后才能继续', //如果需要强制登录,不显示取消按钮 - showCancel: !this.forcedLogin, - success: (res) => { - if (res.confirm) { - //如果需要强制登录,使用reLanch方式 - if (this.forcedLogin) { - uni.reLaunch({ - url: '../login/index' - }) - } else { - uni.navigateTo({ - url: '../login/index' - }) - } - } - } + // uni.showModal({ + // title: '未登录', + // content: '您未登录 , 需要登录后才能继续', //如果需要强制登录,不显示取消按钮 + // showCancel: !this.forcedLogin, + // success: (res) => { + // if (res.confirm) { + // //如果需要强制登录,使用reLanch方式 + // if (this.forcedLogin) { + // uni.reLaunch({ + // url: '../login/index' + // }) + // } else { + // uni.navigateTo({ + // url: '../login/index' + // }) + // } + // } + // } + // }) + uni.reLaunch({ + url: '../login/index' }) } else { this.timerRefresh(); diff --git a/src/pages/productReceipt/job/productReceiptJob.vue b/src/pages/productReceipt/job/productReceiptJob.vue index 40aa4911..38eb5ffd 100644 --- a/src/pages/productReceipt/job/productReceiptJob.vue +++ b/src/pages/productReceipt/job/productReceiptJob.vue @@ -72,7 +72,7 @@ pageNo: 1, pageSize: 10, totalCount: 0, - loadingType: "nomore", + loadingType: "noMore", checkedToday: false, checkedWaitTask: false, todayTime: "", @@ -94,13 +94,7 @@ this.getList('refresh'); }, - onReachBottom() { - //避免多次触发 - if (this.loadingType == 'loading' || this.loadingType == 'nomore') { - return; - } - this.getList("more"); - }, + onPullDownRefresh() { this.getList('refresh'); @@ -126,7 +120,15 @@ } }, - methods: { + methods: { + onReachBottom() { + console.log('onReachBottom',this.loadingType) + //避免多次触发 + if (this.loadingType == 'loading' || this.loadingType == 'noMore') { + return; + } + this.getList("more"); + }, refresh() { this.getList('refresh'); }, @@ -183,9 +185,9 @@ } else { updateTitle("报废收货任务(" + this.totalCount + ")"); } - this.loadingType = "loadmore"; + this.loadingType = "more"; if (list == null || list.length == 0) { - this.loadingType = "nomore"; + this.loadingType = "noMore"; return; } this.jobList = type === "refresh" ? list : this.jobList.concat(list); @@ -332,7 +334,7 @@ goHome() }, onReach() { - if (this.loadingType == 'loading' || this.loadingType == 'nomore') { + if (this.loadingType == 'loading' || this.loadingType == 'noMore') { return; } this.getList("more"); diff --git a/src/pages/productReceipt/job/scrapReceiptJob.vue b/src/pages/productReceipt/job/scrapReceiptJob.vue index 9591e077..431547ee 100644 --- a/src/pages/productReceipt/job/scrapReceiptJob.vue +++ b/src/pages/productReceipt/job/scrapReceiptJob.vue @@ -17,7 +17,9 @@ }; }, - + onReachBottom() { + this.$refs.productreceiptjob.onReach(); + }, onPullDownRefresh() { this.$refs.productreceiptjob.refresh(); }, diff --git a/src/pages/productReceipt/job/semiProductReceiptJob.vue b/src/pages/productReceipt/job/semiProductReceiptJob.vue index 5d2b70a2..0a4dc152 100644 --- a/src/pages/productReceipt/job/semiProductReceiptJob.vue +++ b/src/pages/productReceipt/job/semiProductReceiptJob.vue @@ -17,7 +17,9 @@ }; }, - + onReachBottom() { + this.$refs.productreceiptjob.onReach(); + }, onShow() { if(this.$refs.productreceiptjob!=undefined){ this.$refs.productreceiptjob.refresh();