refactor: Migrate OIDC configuration to system settings

This commit is contained in:
1808837298@qq.com
2025-03-11 22:00:31 +08:00
parent c433af284c
commit 66682584a5
7 changed files with 85 additions and 81 deletions

View File

@@ -6,6 +6,7 @@ import (
"one-api/common"
"one-api/model"
"one-api/setting"
"one-api/setting/system_setting"
"strings"
"github.com/gin-gonic/gin"
@@ -51,8 +52,8 @@ func UpdateOption(c *gin.Context) {
})
return
}
case "OIDCEnabled":
if option.Value == "true" && common.OIDCClientId == "" {
case "oidc.enabled":
if option.Value == "true" && system_setting.GetOIDCSettings().Enabled {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "无法启用 OIDC 登录,请先填入 OIDC Client Id 以及 OIDC Client Secret",