mirror of https://github.com/halo-dev/halo-admin
Refactor ThemeEdit.vue.
parent
85f5114499
commit
8cda3bc740
|
@ -4,12 +4,7 @@ const baseUrl = '/api/admin'
|
|||
|
||||
const commentApi = {}
|
||||
|
||||
/**
|
||||
* Lists comment.
|
||||
* @param {String} target
|
||||
* @param {Object} view
|
||||
*/
|
||||
function latestComment(target, top, status) {
|
||||
commentApi.latestComment = (target, top, status) => {
|
||||
return service({
|
||||
url: `${baseUrl}/${target}/comments/latest`,
|
||||
params: {
|
||||
|
@ -63,18 +58,6 @@ function createComment(target, comment) {
|
|||
})
|
||||
}
|
||||
|
||||
// List latest comment
|
||||
|
||||
commentApi.latestPostComment = (top, status) => {
|
||||
return latestComment('posts', top, status)
|
||||
}
|
||||
commentApi.latestSheetComment = (top, status) => {
|
||||
return latestComment('sheets', top, status)
|
||||
}
|
||||
commentApi.latestJournalComment = (top, status) => {
|
||||
return latestComment('journals', top, status)
|
||||
}
|
||||
|
||||
// Creation api
|
||||
|
||||
commentApi.createPostComment = comment => {
|
||||
|
|
|
@ -170,15 +170,15 @@ export default {
|
|||
this.visible = !this.visible
|
||||
},
|
||||
getComment() {
|
||||
commentApi.latestPostComment(5, 'AUDITING').then(response => {
|
||||
commentApi.latestComment('posts', 5, 'AUDITING').then(response => {
|
||||
this.postComments = response.data.data
|
||||
this.loadding = false
|
||||
})
|
||||
commentApi.latestSheetComment(5, 'AUDITING').then(response => {
|
||||
commentApi.latestComment('sheets', 5, 'AUDITING').then(response => {
|
||||
this.sheetComments = response.data.data
|
||||
this.loadding = false
|
||||
})
|
||||
commentApi.latestJournalComment(5, 'AUDITING').then(response => {
|
||||
commentApi.latestComment('journals', 5, 'AUDITING').then(response => {
|
||||
this.journalComments = response.data.data
|
||||
this.loadding = false
|
||||
})
|
||||
|
|
|
@ -95,7 +95,7 @@ export default {
|
|||
this.buttonDisabled = true
|
||||
return
|
||||
}
|
||||
if (file.name === 'options.yaml' || file.name === 'options.yml') {
|
||||
if (file.name === 'settings.yaml' || file.name === 'settings.yml' || file.name === 'theme.yaml' || file.name === 'theme.yml') {
|
||||
this.$confirm({
|
||||
title: '警告:请谨慎修改该配置文件',
|
||||
content: '修改之后可能会产生不可预料的问题',
|
||||
|
|
Loading…
Reference in New Issue