feat: 允许开关mj回调

This commit is contained in:
CaIon
2024-03-14 21:21:37 +08:00
parent f62dcbf669
commit 4917e5a92f
4 changed files with 30 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package model
import (
"one-api/common"
"one-api/constant"
"strconv"
"strings"
"time"
@@ -88,6 +89,7 @@ func InitOptionMap() {
common.OptionMap["DataExportInterval"] = strconv.Itoa(common.DataExportInterval)
common.OptionMap["DataExportDefaultTime"] = common.DataExportDefaultTime
common.OptionMap["DefaultCollapseSidebar"] = strconv.FormatBool(common.DefaultCollapseSidebar)
common.OptionMap["MjNotifyEnabled"] = strconv.FormatBool(constant.MjNotifyEnabled)
common.OptionMapRWMutex.Unlock()
loadOptionsFromDatabase()
@@ -181,6 +183,8 @@ func updateOptionMap(key string, value string) (err error) {
common.DataExportEnabled = boolValue
case "DefaultCollapseSidebar":
common.DefaultCollapseSidebar = boolValue
case "MjNotifyEnabled":
constant.MjNotifyEnabled = boolValue
}
}
switch key {