diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java index 6cfac1e22d..aefbdef5e4 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java @@ -63,7 +63,7 @@ public class ApiTestService { PluginWrapper pluginWrapper = pluginLoadService.getPluginWrapper(pluginId); checkResourceExist(pluginWrapper); if (pluginWrapper.getPlugin() instanceof AbstractProtocolPlugin protocolPlugin) { - return pluginLoadService.getPluginScriptContent(pluginId, protocolPlugin.getApiProtocolScriptId()); + return pluginLoadService.getPluginScript(pluginId, protocolPlugin.getApiProtocolScriptId()); } else { // 插件不存在或者非接口插件,抛出异常 return checkResourceExist(null); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/PluginLoadService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/PluginLoadService.java index 01a5499212..0095347b52 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/PluginLoadService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/PluginLoadService.java @@ -259,6 +259,10 @@ public class PluginLoadService { return getPluginScriptConfig(pluginId, scriptId).get("script"); } + public Object getPluginScript(String pluginId, String scriptId) { + return getPluginScriptConfig(pluginId, scriptId); + } + public PluginWrapper getPluginWrapper(String id) { return msPluginManager.getPlugin(id); }