mirror of https://github.com/halo-dev/halo
Complete log and option api
parent
1e11a62381
commit
8cdba1b824
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,14 @@
|
||||||
|
import service from '@/utils/service'
|
||||||
|
|
||||||
|
const baseUrl = '/admin/api/logs'
|
||||||
|
|
||||||
|
const logApi = {}
|
||||||
|
|
||||||
|
logApi.listLatest = () => {
|
||||||
|
return service({
|
||||||
|
url: `${baseUrl}/latest`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default logApi
|
|
@ -0,0 +1,22 @@
|
||||||
|
import service from '@/util/service'
|
||||||
|
|
||||||
|
const baseUrl = '/admin/api/options'
|
||||||
|
|
||||||
|
const optionApi = {}
|
||||||
|
|
||||||
|
optionApi.listAll = () => {
|
||||||
|
return service({
|
||||||
|
url: baseUrl,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
optionApi.save = options => {
|
||||||
|
return service({
|
||||||
|
url: `${baseUrl}/saving`,
|
||||||
|
method: 'post',
|
||||||
|
data: options
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default optionApi
|
|
@ -50,6 +50,7 @@
|
||||||
<script>
|
<script>
|
||||||
import postApi from '@/api/post'
|
import postApi from '@/api/post'
|
||||||
import commentApi from '@/api/comment'
|
import commentApi from '@/api/comment'
|
||||||
|
import logApi from '@/api/log'
|
||||||
import adminApi from '@/api/admin'
|
import adminApi from '@/api/admin'
|
||||||
|
|
||||||
const postColumns = [
|
const postColumns = [
|
||||||
|
@ -98,18 +99,21 @@ export default {
|
||||||
return {
|
return {
|
||||||
postLoading: true,
|
postLoading: true,
|
||||||
commentLoading: true,
|
commentLoading: true,
|
||||||
|
logLoading: true,
|
||||||
countsLoading: true,
|
countsLoading: true,
|
||||||
postColumns,
|
postColumns,
|
||||||
postData: [],
|
postData: [],
|
||||||
commentColumns,
|
commentColumns,
|
||||||
commentData: [],
|
commentData: [],
|
||||||
countsData: { attachmentCount: 0, commentCount: 0, establishDays: 0, postCount: 0 }
|
logData: [],
|
||||||
|
countsData: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getCounts()
|
this.getCounts()
|
||||||
this.listLatestPosts()
|
this.listLatestPosts()
|
||||||
this.listLatestComments()
|
this.listLatestComments()
|
||||||
|
this.listLatestLogs()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
listLatestPosts() {
|
listLatestPosts() {
|
||||||
|
@ -124,6 +128,12 @@ export default {
|
||||||
this.commentData = response.data.data
|
this.commentData = response.data.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
listLatestLogs() {
|
||||||
|
logApi.listLatest().then(response => {
|
||||||
|
this.logLoading = false
|
||||||
|
this.logData = response.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
getCounts() {
|
getCounts() {
|
||||||
adminApi.counts().then(response => {
|
adminApi.counts().then(response => {
|
||||||
this.countsLoading = false
|
this.countsLoading = false
|
||||||
|
|
Loading…
Reference in New Issue