From 9168146c9fcada374c548d821f959d5ca1872c17 Mon Sep 17 00:00:00 2001 From: johnniang Date: Tue, 9 Apr 2019 23:08:52 +0800 Subject: [PATCH] Complete theme setting --- src/api/theme.js | 29 +++++- src/views/interface/ThemeList.vue | 144 ++++++++++++++++++++---------- 2 files changed, 125 insertions(+), 48 deletions(-) diff --git a/src/api/theme.js b/src/api/theme.js index 4ac3d8248..3b1e2e0c2 100644 --- a/src/api/theme.js +++ b/src/api/theme.js @@ -27,7 +27,14 @@ themeApi.customTpls = () => { themeApi.active = theme => { return service({ - url: `${baseUrl}/active?theme=${theme}`, + url: `${baseUrl}/${theme}/activation`, + method: 'post' + }) +} + +themeApi.getActivatedTheme = () => { + return service({ + url: `${baseUrl}/activation`, method: 'get' }) } @@ -39,9 +46,25 @@ themeApi.delete = key => { }) } -themeApi.listOptions = theme => { +themeApi.fetchConfiguration = () => { return service({ - url: `${baseUrl}/configurations?name=${theme}` + url: `${baseUrl}/activation/configurations`, + method: 'get' + }) +} + +themeApi.fetchSettings = () => { + return service({ + url: `${baseUrl}/activation/settings`, + method: 'get' + }) +} + +themeApi.saveSettings = settings => { + return service({ + url: `${baseUrl}/activation/settings`, + data: settings, + method: 'post' }) } diff --git a/src/views/interface/ThemeList.vue b/src/views/interface/ThemeList.vue index 511230e02..2590d0dd6 100644 --- a/src/views/interface/ThemeList.vue +++ b/src/views/interface/ThemeList.vue @@ -1,6 +1,10 @@