| | |
| | | import time |
| | | import os |
| | | from Log import logger |
| | | from app.config.const import DIFY |
| | | from app.config.const import DIFY, ENV_CONF_PATH |
| | | from app.models import MenuCapacityModel, WebMenuModel, GroupModel, RoleModel, DialogModel, UserModel, UserAppModel, \ |
| | | cipher_suite |
| | | from app.service.auth import UserAppDao |
| | |
| | | |
| | | async def dialog_menu_sync(db): |
| | | menu_list = [] |
| | | with open("env_conf/menu_conf.json", 'r', encoding='utf-8') as file: |
| | | with open(os.path.join(ENV_CONF_PATH, "menu_conf.json") , 'r', encoding='utf-8') as file: |
| | | # 加载JSON数据 |
| | | data = json.load(file) |
| | | menu_list = data.get("data", []) |
| | |
| | | |
| | | |
| | | async def create_menu_sync(db): |
| | | json_file_path = "env_conf/menu_conf.json.template" |
| | | # json_file_path = "env_conf/menu_conf.json.template" |
| | | json_file_path = os.path.join(ENV_CONF_PATH, "menu_conf.json.template") |
| | | with open(json_file_path, 'r', encoding='utf-8') as file: |
| | | json_data = json.load(file).get("data", []) |
| | | # for menu in json_data: |
| | |
| | | |
| | | async def app_register_sync(db): |
| | | app_dict = {} |
| | | with open("env_conf/app_register_conf.json", 'r', encoding='utf-8') as file: |
| | | with open(os.path.join(ENV_CONF_PATH, "app_register_conf.json"), 'r', encoding='utf-8') as file: |
| | | # 加载JSON数据 |
| | | app_dict = json.load(file) |
| | | try: |
| | |
| | | |
| | | async def basic_agent_sync(db): |
| | | agent_list = [] |
| | | with open("env_conf/default_agent_conf.json", 'r', encoding='utf-8') as file: |
| | | with open(os.path.join(ENV_CONF_PATH, "default_agent_conf.json"), 'r', encoding='utf-8') as file: |
| | | # 加载JSON数据 |
| | | agent_dict = json.load(file) |
| | | agent_list = agent_dict.get("basic", []) |