diff --git a/backend/src/main/java/io/dataease/service/sys/PluginService.java b/backend/src/main/java/io/dataease/service/sys/PluginService.java index 9dd9f5ccd6..2f22d0d619 100644 --- a/backend/src/main/java/io/dataease/service/sys/PluginService.java +++ b/backend/src/main/java/io/dataease/service/sys/PluginService.java @@ -227,7 +227,7 @@ public class PluginService { LogUtil.error(msg); DEException.throwException(msg); } - deleteJarFile(myPlugin); + myPlugin = deleteJarFile(myPlugin); CacheUtils.removeAll(AuthConstants.USER_CACHE_NAME); CacheUtils.removeAll(AuthConstants.USER_ROLE_CACHE_NAME); CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME); @@ -258,18 +258,26 @@ public class PluginService { return true; } - private void deleteJarFile(MyPlugin plugin) { + private MyPlugin deleteJarFile(MyPlugin plugin) { String version = plugin.getVersion(); String moduleName = plugin.getModuleName(); String fileName = moduleName + "-" + version + ".jar"; String path = pluginDir + plugin.getStore() + "/" + fileName; File jarFile = new File(path); + if (!StringUtils.equals("default", plugin.getStore()) && !jarFile.exists()) { + version = "1.0-SNAPSHOT"; + fileName = moduleName + "-" + version + ".jar"; + path = pluginDir + plugin.getStore() + "/" + fileName; + jarFile = new File(path); + plugin.setVersion(version); + } FileUtil.del(jarFile); if (plugin.getCategory().equalsIgnoreCase("datasource")) { File driverFile = new File(pluginDir + plugin.getStore() + "/" + plugin.getDsType() + "Driver"); FileUtil.del(driverFile); } + return plugin; } /** diff --git a/frontend/src/views/system/plugin/index.vue b/frontend/src/views/system/plugin/index.vue index ec1a8c165c..88d169b7c2 100644 --- a/frontend/src/views/system/plugin/index.vue +++ b/frontend/src/views/system/plugin/index.vue @@ -228,7 +228,7 @@ export default { ] } pluginLists(0, 0, param).then((response) => { - this.data = response.data.listObject + this.data = response.data.listObject.filter(item => item.pluginId > 1) this.data.forEach((ele) => { if (ele.cost) { ele.cost = ele.cost.toLocaleString() @@ -283,10 +283,10 @@ export default { this.handlerConfirm(options) }, btnDisabled(row) { - return row.pluginId < 4 + return row.store === 'default' }, updateDisabled(row) { - return row.pluginId === 1 + return row.store === 'default' } } }