diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 9960178..54bbccb 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -23,8 +23,8 @@ const install = (Vue, vm) => { // 请求拦截部分,如配置,每次请求前都会执行 Vue.prototype.$u.http.interceptor.request = (config) => { console.log('config-http', config) - let xtt_lifeData2 = uni.getStorageSync('xtt_lifeData2') - let vuex_token = xtt_lifeData2.vuex_token; + let xtt_lifeData3 = uni.getStorageSync('xtt_lifeData3') + let vuex_token = xtt_lifeData3.vuex_token; if (vuex_token || vm.vuex_token) { config.header['Authorization'] = `Bearer ${vuex_token || vm.vuex_token}`; } @@ -43,12 +43,11 @@ const install = (Vue, vm) => { confirmText: '重新获取', success: function(res) { if (res.confirm) { - uni.removeStorageSync('xtt_lifeData2') + uni.removeStorageSync('xtt_lifeData3') uni.login({ provider: 'weixin', success: (res) => { - let url = baseUrl + - '​/api​/mobile​/user​/login' + let url = baseUrl + '​/api/mobile/user/login' uni.request({ url: url, data:{ @@ -57,31 +56,34 @@ const install = (Vue, vm) => { method: 'GET', success: result => { console.log("result",result) - uni.setStorageSync("xtt_lifeData2",{'vuex_token':result.data.token}) + uni.setStorageSync("xtt_lifeData3",{'vuex_token':result.data.token}) + uni.reLaunch({ + url: '/pages/home/home' + }); + + // const currentPage = + // getCurrentPages()[ + // getCurrentPages() + // .length - 1]; + // const currentPagePath = + // "/" + currentPage.route; + // const currentPageOptions = + // currentPage.options; + // const queryString = Object + // .keys( + // currentPageOptions) + // .map(key => + // `${key}=${currentPageOptions[key]}` + // ) + // .join('&'); + // // 使用uni.reLaunch方法刷新当前页面 - const currentPage = - getCurrentPages()[ - getCurrentPages() - .length - 1]; - const currentPagePath = - "/" + currentPage.route; - const currentPageOptions = - currentPage.options; - const queryString = Object - .keys( - currentPageOptions) - .map(key => - `${key}=${currentPageOptions[key]}` - ) - .join('&'); - // 使用uni.reLaunch方法刷新当前页面 - - uni.reLaunch({ - url: `${currentPagePath}?${queryString}` - }); - console.log("reLaunch", - `${currentPagePath}?${queryString}` - ) + // uni.reLaunch({ + // url: `${currentPagePath}?${queryString}` + // }); + // console.log("reLaunch", + // `${currentPagePath}?${queryString}` + // ) } }); diff --git a/packages/change/change.vue b/packages/change/change.vue index 87fc2a4..189ae2a 100644 --- a/packages/change/change.vue +++ b/packages/change/change.vue @@ -75,6 +75,10 @@ return } this.$u.api.getCard(this.form).then(res => { + if(res.available_dates.length===0){ + toast(this.dateFalse,4000) + return + } let open_date = res.card.sku.open?res.card.sku.open:false let end_date = res.card.sku.end?res.card.sku.end:false let today = this.$moment().format('YYYY-MM-DD') diff --git a/pages/home/home.vue b/pages/home/home.vue index 76f5d77..b52b71c 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -97,9 +97,13 @@