基本功能复刻完成
This commit is contained in:
@@ -706,34 +706,6 @@ func UserGetStripePublicKey(c *gin.Context) {
|
||||
Fail(c, http.StatusBadRequest, "payment is not found")
|
||||
}
|
||||
|
||||
func AdminConfigSave(c *gin.Context) {
|
||||
var payload map[string]any
|
||||
if err := c.ShouldBindJSON(&payload); err != nil {
|
||||
Fail(c, http.StatusBadRequest, "invalid request body")
|
||||
return
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
for key, value := range payload {
|
||||
if nested, ok := value.(map[string]any); ok {
|
||||
for nestedKey, nestedValue := range nested {
|
||||
if err := upsertSetting(nestedKey, nestedValue, now); err != nil {
|
||||
Fail(c, http.StatusInternalServerError, "failed to save config")
|
||||
return
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if err := upsertSetting(key, value, now); err != nil {
|
||||
Fail(c, http.StatusInternalServerError, "failed to save config")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Success(c, true)
|
||||
}
|
||||
|
||||
func quickLoginURL(c *gin.Context, userID int, redirectValues ...string) string {
|
||||
redirect := ""
|
||||
for _, candidate := range redirectValues {
|
||||
|
||||
Reference in New Issue
Block a user