mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-23 23:53:55 +08:00
update:重新规划私有文件的存储目录
This commit is contained in:
@@ -2,7 +2,6 @@ import os
|
||||
import yaml
|
||||
import logging
|
||||
from aiohttp import web
|
||||
from typing import Dict, Any
|
||||
from core.utils.util import get_project_dir
|
||||
from config.private_config import PrivateConfig
|
||||
|
||||
@@ -10,11 +9,11 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class ConfigHandler:
|
||||
def __init__(self):
|
||||
self.private_config_path = get_project_dir() + '.private_config.yaml'
|
||||
self.private_config_path = get_project_dir() + 'data/.private_config.yaml'
|
||||
self.config_path = get_project_dir() + 'config.yaml'
|
||||
# 如果存在.config.yaml文件,则使用该文件
|
||||
if os.path.exists(get_project_dir() + ".config.yaml"):
|
||||
self.config_path = get_project_dir() + ".config.yaml"
|
||||
if os.path.exists(get_project_dir() + "data/.config.yaml"):
|
||||
self.config_path = get_project_dir() + "data/.config.yaml"
|
||||
with open(self.config_path, 'r', encoding='utf-8') as f:
|
||||
self.config = yaml.safe_load(f)
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@ import os
|
||||
import yaml
|
||||
import hashlib
|
||||
import logging
|
||||
from core.utils.util import get_project_dir
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class UserManager:
|
||||
def __init__(self):
|
||||
self.secrets_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), '.secrets.yaml')
|
||||
self.secrets_path = get_project_dir() + 'data/.secrets.yaml'
|
||||
self.users = {}
|
||||
self.ensure_secrets_file()
|
||||
self.load_user_data()
|
||||
|
||||
Reference in New Issue
Block a user