File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 4949from knowledge .serializers .common import BatchSerializer , BatchMoveSerializer
5050from knowledge .serializers .knowledge import KnowledgeSerializer , KnowledgeModelSerializer
5151from maxkb .conf import PROJECT_DIR
52+ from maxkb .const import CONFIG
5253from models_provider .models import Model
5354from models_provider .tools import get_model_instance_by_model_workspace_id
5455from system_manage .models import WorkspaceUserResourcePermission , AuthTargetType
@@ -736,7 +737,8 @@ def get_appstore_templates(self):
736737 self .is_valid (raise_exception = True )
737738 # 下载zip文件
738739 try :
739- res = requests .get ('https://apps-assets.fit2cloud.com/stable/maxkb.json.zip' , timeout = 5 )
740+ appstore_url = CONFIG .get ('APPSTORE_URL' , 'https://apps-assets.fit2cloud.com/stable/maxkb.json.zip' )
741+ res = requests .get (appstore_url , timeout = 5 )
740742 res .raise_for_status ()
741743 # 创建临时文件保存zip
742744 with tempfile .NamedTemporaryFile (delete = False , suffix = '.zip' ) as temp_zip :
Original file line number Diff line number Diff line change 4444from knowledge .task .generate import generate_related_by_knowledge_id
4545from knowledge .task .sync import sync_web_knowledge , sync_replace_web_knowledge
4646from maxkb .conf import PROJECT_DIR
47+ from maxkb .const import CONFIG
4748from models_provider .models import Model
4849from system_manage .models import WorkspaceUserResourcePermission , AuthTargetType
4950from system_manage .models .resource_mapping import ResourceMapping
@@ -761,7 +762,8 @@ def get_appstore_templates(self):
761762 self .is_valid (raise_exception = True )
762763 # 下载zip文件
763764 try :
764- res = requests .get ('https://apps-assets.fit2cloud.com/stable/maxkb.json.zip' , timeout = 5 )
765+ appstore_url = CONFIG .get ('APPSTORE_URL' , 'https://apps-assets.fit2cloud.com/stable/maxkb.json.zip' )
766+ res = requests .get (appstore_url , timeout = 5 )
765767 res .raise_for_status ()
766768 # 创建临时文件保存zip
767769 with tempfile .NamedTemporaryFile (delete = False , suffix = '.zip' ) as temp_zip :
Original file line number Diff line number Diff line change @@ -1044,7 +1044,8 @@ def get_appstore_tools(self):
10441044 self .is_valid (raise_exception = True )
10451045 # 下载zip文件
10461046 try :
1047- res = requests .get ('https://apps-assets.fit2cloud.com/stable/maxkb.json.zip' , timeout = 5 )
1047+ appstore_url = CONFIG .get ('APPSTORE_URL' , 'https://apps-assets.fit2cloud.com/stable/maxkb.json.zip' )
1048+ res = requests .get (appstore_url , timeout = 5 )
10481049 res .raise_for_status ()
10491050 # 创建临时文件保存zip
10501051 with tempfile .NamedTemporaryFile (delete = False , suffix = '.zip' ) as temp_zip :
You can’t perform that action at this time.
0 commit comments