diff --git a/src/main/java/cn/wizzer/modules/controllers/platform/sys/SysPluginController.java b/src/main/java/cn/wizzer/modules/controllers/platform/sys/SysPluginController.java index 60d3390b2..2979063ad 100644 --- a/src/main/java/cn/wizzer/modules/controllers/platform/sys/SysPluginController.java +++ b/src/main/java/cn/wizzer/modules/controllers/platform/sys/SysPluginController.java @@ -59,11 +59,12 @@ public Object addDo(@Param("code") String code, throws IOException { try { String name = tf.getSubmittedFileName().substring(tf.getSubmittedFileName().indexOf(".")).toLowerCase(); - byte[] buf = Streams.readBytesAndClose(tf.getInputStream()); String p = Globals.AppRoot; String f = Globals.AppUploadPath + "/plugin/" + DateUtil.format(new Date(), "yyyyMMdd") + "/" + R.UU32() + name; File file = new File(p + f); + Files.createFileIfNoExists(file); Files.write(f, tf.getInputStream()); + byte[] buf = Files.readBytes(file); IPlugin plugin; if (".jar".equals(name)) { plugin = pluginMaster.buildFromJar(file, className, buf);