chore: add theme validation

This commit is contained in:
JustSong
2024-01-07 18:44:26 +08:00
parent 37afb313b5
commit bdd4be562d
2 changed files with 13 additions and 1 deletions

View File

@@ -42,6 +42,14 @@ func UpdateOption(c *gin.Context) {
return
}
switch option.Key {
case "Theme":
if !common.ValidThemes[option.Value] {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "无效的主题",
})
return
}
case "GitHubOAuthEnabled":
if option.Value == "true" && common.GitHubClientId == "" {
c.JSON(http.StatusOK, gin.H{