diff --git a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java index 5e73b45b2..9b661543b 100644 --- a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java +++ b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java @@ -63,8 +63,10 @@ public class PluginOperateUtils { JSONObject latestPluginInfo = PluginUtils.getLatestPluginInfo(pluginMarker.getPluginID()); String latestPluginVersion = (String) latestPluginInfo.get("version"); PluginMarker toPluginMarker = PluginMarker.create(pluginMarker.getPluginID(), latestPluginVersion); - PluginTask pluginTask = PluginTask.updateTask(pluginMarker, toPluginMarker); - PluginControllerHelper.updateOnline(pluginMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback)); + //当前已经安装的相同ID插件marker + PluginMarker currentMarker = PluginUtils.getInstalledPluginMarkerByID(pluginMarker.getPluginID()); + PluginTask pluginTask = PluginTask.updateTask(currentMarker, toPluginMarker); + PluginControllerHelper.updateOnline(currentMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback)); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); } diff --git a/designer_base/src/com/fr/design/extra/PluginUtils.java b/designer_base/src/com/fr/design/extra/PluginUtils.java index 9f2c79c09..0e6ae15a1 100644 --- a/designer_base/src/com/fr/design/extra/PluginUtils.java +++ b/designer_base/src/com/fr/design/extra/PluginUtils.java @@ -11,6 +11,7 @@ import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.error.PluginErrorCode; +import com.fr.plugin.manage.PluginManager; import com.fr.plugin.view.PluginView; import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; @@ -173,4 +174,13 @@ public class PluginUtils { return ERROR_CODE_I18N_PREFIX + errorCode.getDescription(); } + + public static PluginMarker getInstalledPluginMarkerByID(String pluginID) { + + PluginContext context = PluginManager.getContext(pluginID); + if (context != null) { + return context.getMarker(); + } + return null; + } }