From ad7705cf4cc2f7dd04dc479487a47cd5c482c67f Mon Sep 17 00:00:00 2001 From: johnniang Date: Sun, 21 Apr 2019 00:53:25 +0800 Subject: [PATCH] Fix theme setting saving bug --- src/api/theme.js | 8 +- src/views/interface/ThemeList.vue | 157 +++++++++++++++++++++++------- 2 files changed, 124 insertions(+), 41 deletions(-) diff --git a/src/api/theme.js b/src/api/theme.js index 897a0955..07d10338 100644 --- a/src/api/theme.js +++ b/src/api/theme.js @@ -53,16 +53,16 @@ themeApi.fetchConfiguration = themeId => { }) } -themeApi.fetchSettings = () => { +themeApi.fetchSettings = themeId => { return service({ - url: `${baseUrl}/activation/settings`, + url: `${baseUrl}/${themeId}/settings`, method: 'get' }) } -themeApi.saveSettings = settings => { +themeApi.saveSettings = (themeId, settings) => { return service({ - url: `${baseUrl}/activation/settings`, + url: `${baseUrl}/${themeId}/settings`, data: settings, method: 'post' }) diff --git a/src/views/interface/ThemeList.vue b/src/views/interface/ThemeList.vue index b0b56302..27d2aaa8 100644 --- a/src/views/interface/ThemeList.vue +++ b/src/views/interface/ThemeList.vue @@ -1,30 +1,60 @@