29936
This commit is contained in:
@@ -30,6 +30,9 @@ instance.interceptors.request.use(config => {
|
|||||||
instance.interceptors.response.use(res => {
|
instance.interceptors.response.use(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
if (res.data.access_token) {
|
||||||
|
return res.data
|
||||||
|
}
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
return res.data
|
return res.data
|
||||||
} else if (res.data.code === 1) {
|
} else if (res.data.code === 1) {
|
||||||
@@ -49,7 +52,7 @@ instance.interceptors.response.use(res => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error("服务器异常,请联系管理员!")
|
console.error("服务器异常,请联系管理员!")
|
||||||
return Promise.reject(res.data)
|
return res.data
|
||||||
}
|
}
|
||||||
}, err => {
|
}, err => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|||||||
@@ -68,11 +68,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
onLoad (query) {
|
||||||
this.isAdmin = !!this.$store.state.user.adminAuthType
|
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')
|
if (query.date) {
|
||||||
this.DD = this.$dayjs(new Date).format('DD')
|
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.getList()
|
||||||
this.getTotal()
|
this.getTotal()
|
||||||
},
|
},
|
||||||
@@ -105,10 +113,10 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onDateChange (e) {
|
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.yyyyMM = `${e.year}年${e.month > 9 ? e.month : '0' + e.month}月`
|
||||||
this.DD = e.day
|
this.DD = e.day > 9 ? e.day : '0' + e.day
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<div class="info-item info-work">
|
<div class="info-item info-work">
|
||||||
<div class="info-item__title">
|
<div class="info-item__title">
|
||||||
<h2>考勤统计</h2>
|
<h2>考勤统计</h2>
|
||||||
<image src="../images/right.png" @click="linkTo('./Attendance')" />
|
<image src="../images/right.png" @click="linkTo('./Attendance?date=' + date.replace(/年|月/g, '-'))" />
|
||||||
</div>
|
</div>
|
||||||
<div class="info-work__wrapper">
|
<div class="info-work__wrapper">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
mounted () {
|
mounted () {
|
||||||
this.date = this.$dayjs(new Date).format('YYYY年MM月DD')
|
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.DD = this.$dayjs(new Date).format('DD')
|
||||||
this.getPhotoTotal()
|
this.getPhotoTotal()
|
||||||
},
|
},
|
||||||
@@ -154,10 +154,10 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onDateChange (e) {
|
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.yyyyMM = `${e.year}年${e.month > 9 ? e.month : '0' + e.month}月`
|
||||||
this.DD = e.day
|
this.DD = e.day > 9 ? e.day : '0' + e.day
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.getPhotoTotal()
|
this.getPhotoTotal()
|
||||||
|
|||||||
Reference in New Issue
Block a user