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>
|
||||
import postApi from '@/api/post'
|
||||
import commentApi from '@/api/comment'
|
||||
import logApi from '@/api/log'
|
||||
import adminApi from '@/api/admin'
|
||||
|
||||
const postColumns = [
|
||||
|
@ -98,18 +99,21 @@ export default {
|
|||
return {
|
||||
postLoading: true,
|
||||
commentLoading: true,
|
||||
logLoading: true,
|
||||
countsLoading: true,
|
||||
postColumns,
|
||||
postData: [],
|
||||
commentColumns,
|
||||
commentData: [],
|
||||
countsData: { attachmentCount: 0, commentCount: 0, establishDays: 0, postCount: 0 }
|
||||
logData: [],
|
||||
countsData: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getCounts()
|
||||
this.listLatestPosts()
|
||||
this.listLatestComments()
|
||||
this.listLatestLogs()
|
||||
},
|
||||
methods: {
|
||||
listLatestPosts() {
|
||||
|
@ -124,6 +128,12 @@ export default {
|
|||
this.commentData = response.data.data
|
||||
})
|
||||
},
|
||||
listLatestLogs() {
|
||||
logApi.listLatest().then(response => {
|
||||
this.logLoading = false
|
||||
this.logData = response.data.data
|
||||
})
|
||||
},
|
||||
getCounts() {
|
||||
adminApi.counts().then(response => {
|
||||
this.countsLoading = false
|
||||
|
|
Loading…
Reference in New Issue