From 4d5d5a5926ffa5813791c5b946e936adb9d35f78 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Sat, 4 May 2019 16:11:46 +0800 Subject: [PATCH] Refactor codes. --- src/views/attachment/AttachmentList.vue | 10 +++++++-- src/views/dashboard/Dashboard.vue | 6 ++++-- src/views/system/OptionForm.vue | 2 +- src/views/user/Profile.vue | 28 ++++++++++++++----------- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index 3ab2e606..210c50db 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -26,7 +26,10 @@ :sm="24" > - + - + + diff --git a/src/views/system/OptionForm.vue b/src/views/system/OptionForm.vue index fef0b450..01049d68 100644 --- a/src/views/system/OptionForm.vue +++ b/src/views/system/OptionForm.vue @@ -22,7 +22,7 @@ diff --git a/src/views/user/Profile.vue b/src/views/user/Profile.vue index 078b1825..ead45178 100644 --- a/src/views/user/Profile.vue +++ b/src/views/user/Profile.vue @@ -6,9 +6,7 @@ :md="24" :style="{ 'padding-bottom': '12px' }" > - +

- - http://localhost:8090 + >{{ options.blog_url }}

- - {{ user.email }} + {{ user.email }}

- - {{ counts.establishDays || 0 }} 天 + {{ counts.establishDays || 0 }} 天

@@ -152,6 +147,7 @@ import AttachmentSelectDrawer from '../attachment/components/AttachmentSelectDrawer' import userApi from '@/api/user' import adminApi from '@/api/admin' +import optionApi from '@/api/option' export default { components: { @@ -168,7 +164,9 @@ export default { newPassword: null, confirmPassword: null }, - attachment: {} + attachment: {}, + options: [], + keys: 'blog_url' } }, computed: { @@ -179,6 +177,7 @@ export default { created() { this.loadUser() this.getCounts() + this.loadOptions() }, methods: { handleShowAttachDrawer() { @@ -190,6 +189,11 @@ export default { this.profileLoading = false }) }, + loadOptions() { + optionApi.listByKeys(this.keys).then(response => { + this.options = response.data.data + }) + }, getCounts() { adminApi.counts().then(response => { this.counts = response.data.data