diff --git a/app/Http/Controllers/Admin/ThemeController.php b/app/Http/Controllers/Admin/ThemeController.php index dcf2dc9d..eb7f754a 100644 --- a/app/Http/Controllers/Admin/ThemeController.php +++ b/app/Http/Controllers/Admin/ThemeController.php @@ -31,14 +31,20 @@ class ThemeController extends Controller $themeConfigs[$this->themes] = $themeConfig; } return response([ - 'data' => $themeConfigs + 'data' => [ + 'themes' => $themeConfigs, + 'active' => config('v2board.theme', 'v2board') + ] ]); } public function getThemeConfig(Request $request) { + $payload = $request->validate([ + 'name' => 'required|in:' . join(',', $this->themes) + ]); return response([ - 'data' => config('theme.v2board') + 'data' => config("theme.{$payload['name']}") ]); } diff --git a/database/update.sql b/database/update.sql index 738ffa94..26933e96 100644 --- a/database/update.sql +++ b/database/update.sql @@ -562,8 +562,10 @@ ALTER TABLE `v2_notice` ADD `tags` varchar(255) COLLATE 'utf8_general_ci' NULL AFTER `img_url`; ALTER TABLE `v2_ticket` -DROP `last_reply_user_id`, ADD `reply_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0:待回复 1:已回复' AFTER `status`; ALTER TABLE `v2_server_v2ray` DROP `settings`; + +ALTER TABLE `v2_ticket` +DROP `last_reply_user_id`;