diff --git a/App.vue b/App.vue index 6c4adc6..e1cccfb 100644 --- a/App.vue +++ b/App.vue @@ -17,9 +17,22 @@ export default { }); await this.login(); - const params = { param: { token: this.token } }; + + const startTime = +this.$moment() + .startOf('year') + .format('x'); + const endTime = +this.$moment() + .endOf('day') + .format('x'); + const params = { + param: { + startTime, + endTime, + token: this.token + } + }; await this.getUserInfo(params); - await this.getHealthTypeStaus(); + await this.getHealthTypeStatus(); }, computed: mapState('user', ['token']), diff --git a/main.js b/main.js index 0aeb3f3..65c6891 100644 --- a/main.js +++ b/main.js @@ -29,9 +29,13 @@ Vue.prototype.goHome = () => { Vue.prototype.openPage = function(path, query = '') { let url = query ? `${path}?${query}` : path; store.commit('user/setPagePath',url) - if(!store.state.user.userInfo) { + // 白名单页面 + const whiteListPath = ['/pages/basic-info/basic-info','/pages/statistics/statistics','/pages/user-code/user-code'] + const choosePath = whiteListPath.indexOf(path) + if(!store.state.user.userInfo && !store.state.user.userInfo.id && choosePath === -1) { url = '/pages/basic-info/basic-info'; } + uni.navigateTo({ url }); }; diff --git a/pages/basic-info/basic-info.vue b/pages/basic-info/basic-info.vue index 135e13a..ffabbad 100644 --- a/pages/basic-info/basic-info.vue +++ b/pages/basic-info/basic-info.vue @@ -3,7 +3,7 @@
-