Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-12-26 11:21:47 +08:00
parent cef8ca8cf7
commit a65dcd220f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 13 additions and 7 deletions

View file

@ -82,6 +82,7 @@ type AppConf struct {
CloudRegion int `json:"cloudRegion"` // 云端区域0中国大陆1北美
Snippet *conf.Snpt `json:"snippet"` // 代码片段
DataIndexState int `json:"dataIndexState"` // 数据索引状态0已索引1未索引
CookieKey string `json:"cookieKey"` // 用于加密 Cookie 的密钥
m *sync.RWMutex // 配置数据锁
userLock *sync.RWMutex // 用户数据独立锁,避免与配置保存操作竞争
@ -579,6 +580,10 @@ func InitConf() {
Conf.DataIndexState = 0
if "" == Conf.CookieKey {
Conf.CookieKey = gulu.Rand.String(16)
}
Conf.Save()
logging.SetLogLevel(Conf.LogLevel)