diff --git a/app/Services/ThemeService.php b/app/Services/ThemeService.php index d72eb66..4218c49 100644 --- a/app/Services/ThemeService.php +++ b/app/Services/ThemeService.php @@ -191,8 +191,12 @@ class ThemeService /** * 切换主题 */ - public function switch(string $theme): bool + public function switch(string|null $theme): bool { + if ($theme === null) { + return true; + } + $currentTheme = admin_setting('current_theme'); try {