diff --git a/src/common/server.py b/src/common/server.py index 15f5de16a..6feb72731 100644 --- a/src/common/server.py +++ b/src/common/server.py @@ -54,8 +54,12 @@ class Server: # 配置 CORS origins = [ - "http://localhost:3000", # 允许的前端源 + "http://localhost:3000", "http://127.0.0.1:3000", + "http://localhost:11451", + "http://127.0.0.1:11451", + "http://localhost:3001", + "http://127.0.0.1:3001", # 在生产环境中,您应该添加实际的前端域名 ] diff --git a/src/plugin_system/core/component_registry.py b/src/plugin_system/core/component_registry.py index 2218a4fb1..b6715515c 100644 --- a/src/plugin_system/core/component_registry.py +++ b/src/plugin_system/core/component_registry.py @@ -560,7 +560,7 @@ class ComponentRegistry: component_instance = router_class() server = get_global_server() # 生成唯一的 URL 前缀,格式为 /plugins/{plugin_name} - prefix = f"/plugins/{info.plugin_name}" + prefix = f"/plugins/{info.plugin_name}/{info.name}" # 将插件的路由包含到主应用中 server.app.include_router(component_instance.router, prefix=prefix, tags=[info.plugin_name])