From b1345b685028f6675d544273d02a1d00300eea64 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Sun, 5 May 2019 00:22:09 +0800 Subject: [PATCH] Refactor Dashboard.vue. --- src/api/log.js | 5 ++++- src/views/dashboard/Dashboard.vue | 22 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/api/log.js b/src/api/log.js index 5d6dc331..69ddcdfd 100644 --- a/src/api/log.js +++ b/src/api/log.js @@ -4,9 +4,12 @@ const baseUrl = '/api/admin/logs' const logApi = {} -logApi.listLatest = () => { +logApi.listLatest = (top) => { return service({ url: `${baseUrl}/latest`, + params: { + top: top + }, method: 'get' }) } diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue index 7c716f01..5b4f4c0e 100644 --- a/src/views/dashboard/Dashboard.vue +++ b/src/views/dashboard/Dashboard.vue @@ -101,7 +101,7 @@ :loading="activityLoading" :bordered="false" title="新动态" - :bodyStyle="{ padding: '16px' }" + :bodyStyle="{ padding: 0 }" >
- 保存 + 保存 @@ -218,7 +221,18 @@ title="日志记录" :bodyStyle="{ padding: '16px' }" > - 日志记录 + + + + {{ item.type }} + +
{{ item.content }}
+
+
@@ -281,7 +295,7 @@ export default { }) }, listLatestLogs() { - logApi.listLatest().then(response => { + logApi.listLatest(5).then(response => { this.logData = response.data.data this.logLoading = false })