mirror of https://github.com/halo-dev/halo
Fix theme activation bug
parent
ea761fa73f
commit
175739dbd4
|
@ -19,8 +19,8 @@ import java.util.Map;
|
||||||
* @author johnniang
|
* @author johnniang
|
||||||
* @date 19-4-20
|
* @date 19-4-20
|
||||||
*/
|
*/
|
||||||
@Component
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Component
|
||||||
public class FreemarkerConfigAwareListener {
|
public class FreemarkerConfigAwareListener {
|
||||||
|
|
||||||
private final OptionService optionService;
|
private final OptionService optionService;
|
||||||
|
|
|
@ -210,7 +210,7 @@ public interface ThemeService {
|
||||||
* @return theme property
|
* @return theme property
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
ThemeProperty activeTheme(@NonNull String themeId);
|
ThemeProperty activateTheme(@NonNull String themeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload theme.
|
* Upload theme.
|
||||||
|
|
|
@ -316,7 +316,7 @@ public class ThemeServiceImpl implements ThemeService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ThemeProperty activeTheme(String themeId) {
|
public ThemeProperty activateTheme(String themeId) {
|
||||||
// Check existence of the theme
|
// Check existence of the theme
|
||||||
ThemeProperty themeProperty = getThemeOfNonNullBy(themeId);
|
ThemeProperty themeProperty = getThemeOfNonNullBy(themeId);
|
||||||
|
|
||||||
|
@ -508,6 +508,7 @@ public class ThemeServiceImpl implements ThemeService {
|
||||||
*/
|
*/
|
||||||
private void setActivatedTheme(@Nullable ThemeProperty activatedTheme) {
|
private void setActivatedTheme(@Nullable ThemeProperty activatedTheme) {
|
||||||
this.activatedTheme = activatedTheme;
|
this.activatedTheme = activatedTheme;
|
||||||
|
this.activatedThemeId = activatedTheme.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class ThemeController {
|
||||||
@PostMapping("{themeId}/activation")
|
@PostMapping("{themeId}/activation")
|
||||||
@ApiOperation("Activates a theme")
|
@ApiOperation("Activates a theme")
|
||||||
public ThemeProperty active(@PathVariable("themeId") String themeId) {
|
public ThemeProperty active(@PathVariable("themeId") String themeId) {
|
||||||
return themeService.activeTheme(themeId);
|
return themeService.activateTheme(themeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("activation")
|
@GetMapping("activation")
|
||||||
|
|
Loading…
Reference in New Issue