From 519930bc1112cdf7881fecce907381ce6374e74c Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期二, 14 一月 2025 13:37:56 +0800
Subject: [PATCH] 文档出卷-未上传文件提示
---
app/service/v2/initialize_data.py | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/service/v2/initialize_data.py b/app/service/v2/initialize_data.py
index f681c56..d6df64b 100644
--- a/app/service/v2/initialize_data.py
+++ b/app/service/v2/initialize_data.py
@@ -2,7 +2,7 @@
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
@@ -17,7 +17,7 @@
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", [])
@@ -40,7 +40,8 @@
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:
@@ -107,7 +108,7 @@
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:
@@ -119,7 +120,7 @@
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", [])
@@ -137,8 +138,7 @@
else:
try:
dialog = DialogModel(id=agent["id"], name=agent["name"], description=agent["description"],
- icon=agent["icon"], tenant_id=user.id if user else "", dialog_type="3",
- agent_id=agent["id"])
+ icon=agent["icon"], tenant_id=user.id if user else "", dialog_type=agent["dialogType"], mode=agent["mode"])
db.add(dialog)
db.commit()
db.refresh(dialog)
--
Gitblit v1.8.0