mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-02-22 16:38:27 +08:00
feat: add global admin config
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import json
|
||||
from config import pconf, plugin_config
|
||||
from config import pconf, plugin_config, conf
|
||||
from common.log import logger
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ class Plugin:
|
||||
"""
|
||||
# 优先获取 plugins/config.json 中的全局配置
|
||||
plugin_conf = pconf(self.name)
|
||||
if not plugin_conf:
|
||||
# 全局配置不存在,则获取插件目录下的配置
|
||||
if not plugin_conf or not conf().get("use_global_plugin_config"):
|
||||
# 全局配置不存在 或者 未开启全局配置开关,则获取插件目录下的配置
|
||||
plugin_config_path = os.path.join(self.path, "config.json")
|
||||
if os.path.exists(plugin_config_path):
|
||||
with open(plugin_config_path, "r") as f:
|
||||
|
||||
Reference in New Issue
Block a user