29935
This commit is contained in:
@@ -29,26 +29,23 @@ instance.interceptors.request.use(config => {
|
|||||||
|
|
||||||
instance.interceptors.response.use(res => {
|
instance.interceptors.response.use(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
if (res.data.code) {
|
uni.hideLoading()
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
return res.data
|
|
||||||
} else if (res.data.code === 1) {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.data.msg,
|
|
||||||
duration: 2000,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
|
|
||||||
return res.data
|
|
||||||
} else if (res.data.code == 401) {
|
|
||||||
store.commit("logout");
|
|
||||||
uni.navigateTo({url: "/pages/login"})
|
|
||||||
} else {
|
|
||||||
console.error(res.data.msg || "请求失败!")
|
|
||||||
return Promise.reject(res.data.msg)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return res.data
|
return res.data
|
||||||
|
} else if (res.data.code === 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
duration: 2000,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
|
||||||
|
return res.data
|
||||||
|
} else if (res.data.code == 401) {
|
||||||
|
store.commit("logout");
|
||||||
|
uni.navigateTo({url: "/pages/login"})
|
||||||
|
} else {
|
||||||
|
console.error(res.data.msg || "请求失败!")
|
||||||
|
return Promise.reject(res.data.msg)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error("服务器异常,请联系管理员!")
|
console.error("服务器异常,请联系管理员!")
|
||||||
|
|||||||
@@ -61,32 +61,18 @@
|
|||||||
all: '1',
|
all: '1',
|
||||||
hasIn: '',
|
hasIn: '',
|
||||||
hasOut: '',
|
hasOut: '',
|
||||||
|
yyyyMM: '',
|
||||||
|
DD: '',
|
||||||
isShow: false,
|
isShow: false,
|
||||||
isAdmin: false
|
isAdmin: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
|
||||||
yyyyMM () {
|
|
||||||
if (this.date) {
|
|
||||||
return this.date.substr(0, 8)
|
|
||||||
}
|
|
||||||
|
|
||||||
return ''
|
|
||||||
},
|
|
||||||
|
|
||||||
DD () {
|
|
||||||
if (this.date) {
|
|
||||||
return this.date.substr(8)
|
|
||||||
}
|
|
||||||
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
created () {
|
created () {
|
||||||
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.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()
|
||||||
},
|
},
|
||||||
@@ -121,6 +107,9 @@
|
|||||||
onDateChange (e) {
|
onDateChange (e) {
|
||||||
this.date = `${e.year}年${e.month}月${e.day}`
|
this.date = `${e.year}年${e.month}月${e.day}`
|
||||||
|
|
||||||
|
this.yyyyMM = `${e.year}年${e.month}月`
|
||||||
|
this.DD = e.day
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getTotal()
|
this.getTotal()
|
||||||
|
|||||||
@@ -102,27 +102,13 @@
|
|||||||
list: [],
|
list: [],
|
||||||
isMore: false,
|
isMore: false,
|
||||||
isShow: false,
|
isShow: false,
|
||||||
|
yyyyMM: '',
|
||||||
|
DD: '',
|
||||||
attendanceCount: {}
|
attendanceCount: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
yyyyMM () {
|
|
||||||
if (this.date) {
|
|
||||||
return this.date.substr(0, 8)
|
|
||||||
}
|
|
||||||
|
|
||||||
return ''
|
|
||||||
},
|
|
||||||
|
|
||||||
DD () {
|
|
||||||
if (this.date) {
|
|
||||||
return this.date.substr(8)
|
|
||||||
}
|
|
||||||
|
|
||||||
return ''
|
|
||||||
},
|
|
||||||
|
|
||||||
rate () {
|
rate () {
|
||||||
if (!this.attendanceCount.all) {
|
if (!this.attendanceCount.all) {
|
||||||
return '0'
|
return '0'
|
||||||
@@ -134,6 +120,8 @@
|
|||||||
|
|
||||||
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.DD = this.$dayjs(new Date).format('DD')
|
||||||
this.getPhotoTotal()
|
this.getPhotoTotal()
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -168,6 +156,9 @@
|
|||||||
onDateChange (e) {
|
onDateChange (e) {
|
||||||
this.date = `${e.year}年${e.month}月${e.day}`
|
this.date = `${e.year}年${e.month}月${e.day}`
|
||||||
|
|
||||||
|
this.yyyyMM = `${e.year}年${e.month}月`
|
||||||
|
this.DD = e.day
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.getPhotoTotal()
|
this.getPhotoTotal()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -148,6 +148,7 @@
|
|||||||
let formData = new FormData()
|
let formData = new FormData()
|
||||||
formData.append('file', res.tempFiles[0])
|
formData.append('file', res.tempFiles[0])
|
||||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
||||||
|
console.log(res)
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.richList.push({
|
this.richList.push({
|
||||||
type: 'img',
|
type: 'img',
|
||||||
|
|||||||
Reference in New Issue
Block a user