diff --git a/src/common/axios.js b/src/common/axios.js index 97476bdd..e5bd89cb 100644 --- a/src/common/axios.js +++ b/src/common/axios.js @@ -30,6 +30,9 @@ instance.interceptors.request.use(config => { instance.interceptors.response.use(res => { if (res.data) { uni.hideLoading() + if (res.data.access_token) { + return res.data + } if (res.data.code == 0) { return res.data } else if (res.data.code === 1) { @@ -49,7 +52,7 @@ instance.interceptors.response.use(res => { } } else { console.error("服务器异常,请联系管理员!") - return Promise.reject(res.data) + return res.data } }, err => { uni.hideLoading() diff --git a/src/saas/AppCountryAlbum/Attendance.vue b/src/saas/AppCountryAlbum/Attendance.vue index 42e40add..c57465dc 100644 --- a/src/saas/AppCountryAlbum/Attendance.vue +++ b/src/saas/AppCountryAlbum/Attendance.vue @@ -68,11 +68,19 @@ } }, - created () { + onLoad (query) { this.isAdmin = !!this.$store.state.user.adminAuthType - this.date = this.$dayjs(new Date).format('YYYY年MM月DD') - this.yyyyMM = this.$dayjs(new Date).format('YYYY年MM') - this.DD = this.$dayjs(new Date).format('DD') + + if (query.date) { + this.date = this.$dayjs(query.date).format('YYYY年MM月DD') + this.yyyyMM = this.$dayjs(query.date).format('YYYY年MM月') + this.DD = this.$dayjs(query.date).format('DD') + } else { + this.date = this.$dayjs(new Date).format('YYYY年MM月DD') + this.yyyyMM = this.$dayjs(new Date).format('YYYY年MM月') + this.DD = this.$dayjs(new Date).format('DD') + } + this.getList() this.getTotal() }, @@ -105,10 +113,10 @@ }, onDateChange (e) { - this.date = `${e.year}年${e.month}月${e.day}` + this.date = `${e.year}年${e.month > 9 ? e.month : '0' + e.month}月${e.day > 9 ? e.day : '0' + e.day}` - this.yyyyMM = `${e.year}年${e.month}月` - this.DD = e.day + this.yyyyMM = `${e.year}年${e.month > 9 ? e.month : '0' + e.month}月` + this.DD = e.day > 9 ? e.day : '0' + e.day this.$nextTick(() => { this.getList() diff --git a/src/saas/AppCountryAlbum/components/Organize.vue b/src/saas/AppCountryAlbum/components/Organize.vue index 18ca952e..874baa90 100644 --- a/src/saas/AppCountryAlbum/components/Organize.vue +++ b/src/saas/AppCountryAlbum/components/Organize.vue @@ -47,7 +47,7 @@

考勤统计

- +
@@ -120,7 +120,7 @@ mounted () { this.date = this.$dayjs(new Date).format('YYYY年MM月DD') - this.yyyyMM = this.$dayjs(new Date).format('YYYY年MM') + this.yyyyMM = this.$dayjs(new Date).format('YYYY年MM月') this.DD = this.$dayjs(new Date).format('DD') this.getPhotoTotal() }, @@ -154,10 +154,10 @@ }, onDateChange (e) { - this.date = `${e.year}年${e.month}月${e.day}` + this.date = `${e.year}年${e.month > 9 ? e.month : '0' + e.month}月${e.day > 9 ? e.day : '0' + e.day}` - this.yyyyMM = `${e.year}年${e.month}月` - this.DD = e.day + this.yyyyMM = `${e.year}年${e.month > 9 ? e.month : '0' + e.month}月` + this.DD = e.day > 9 ? e.day : '0' + e.day this.$nextTick(() => { this.getPhotoTotal()