diff --git a/src/api/comment.js b/src/api/comment.js index 64b1f9c93..e35a5ac90 100644 --- a/src/api/comment.js +++ b/src/api/comment.js @@ -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 => { diff --git a/src/components/Tools/HeaderComment.vue b/src/components/Tools/HeaderComment.vue index 4fd3358c1..9b6e74a0e 100644 --- a/src/components/Tools/HeaderComment.vue +++ b/src/components/Tools/HeaderComment.vue @@ -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 }) diff --git a/src/views/interface/ThemeEdit.vue b/src/views/interface/ThemeEdit.vue index 7a1f43a7e..5e0e6b66f 100644 --- a/src/views/interface/ThemeEdit.vue +++ b/src/views/interface/ThemeEdit.vue @@ -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: '修改之后可能会产生不可预料的问题',