mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
feat: picture auto-generate
This commit is contained in:
18
config.py
18
config.py
@@ -10,16 +10,14 @@ config = {}
|
||||
def load_config():
|
||||
global config
|
||||
config_path = "config.json"
|
||||
try:
|
||||
if not os.path.exists(config_path):
|
||||
logger.error('配置文件路径不存在')
|
||||
return
|
||||
config_str = read_file(config_path)
|
||||
# 将json字符串反序列化为dict类型
|
||||
config = json.loads(config_str)
|
||||
logger.info("[INIT] load config: {}".format(config))
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
if not os.path.exists(config_path):
|
||||
raise Exception('配置文件不存在,请根据config-template.json模板创建config.json文件')
|
||||
|
||||
config_str = read_file(config_path)
|
||||
# 将json字符串反序列化为dict类型
|
||||
config = json.loads(config_str)
|
||||
logger.info("[INIT] load config: {}".format(config))
|
||||
|
||||
|
||||
|
||||
def get_root():
|
||||
|
||||
Reference in New Issue
Block a user