diff --git a/servlet-core/src/main/java/tech/smartboot/servlet/plugins/license/LicensePlugin.java b/servlet-core/src/main/java/tech/smartboot/servlet/plugins/license/LicensePlugin.java index 12fe4f94..4faae07e 100644 --- a/servlet-core/src/main/java/tech/smartboot/servlet/plugins/license/LicensePlugin.java +++ b/servlet-core/src/main/java/tech/smartboot/servlet/plugins/license/LicensePlugin.java @@ -26,12 +26,10 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.NetworkInterface; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; -import java.util.Enumeration; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -123,6 +121,7 @@ private void loadLicense() { licenseTO = loadLicense(entity); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println(":: Licensed to " + ConsoleColors.BOLD + ConsoleColors.ANSI_UNDERLINE_ON + ConsoleColors.BLUE + licenseTO.getApplicant() + ConsoleColors.ANSI_RESET + " until " + ConsoleColors.BOLD + ConsoleColors.ANSI_UNDERLINE_ON + ConsoleColors.BLUE + sdf.format(new Date(licenseTO.getExpireTime())) + ConsoleColors.ANSI_RESET); + System.out.println(":: SN: " + ConsoleColors.BOLD + ConsoleColors.ANSI_UNDERLINE_ON + licenseTO.getSn() + ConsoleColors.RESET); System.out.println(":: Copyright© " + licenseTO.getVendor() + " ,E-mail: " + licenseTO.getContact()); if (licenseTO.getTrialDuration() > 0) { System.out.println(ConsoleColors.RED + ":: Trial: " + licenseTO.getTrialDuration() + " minutes" + ConsoleColors.RESET); @@ -151,28 +150,25 @@ private LicenseTO loadLicense(LicenseEntity entity) throws IOException { private List getMacAddresses() { List macs = new ArrayList<>(); - try { - Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); - while (networkInterfaces.hasMoreElements()) { - NetworkInterface networkInterface = networkInterfaces.nextElement(); - byte[] mac = networkInterface.getHardwareAddress(); - if (mac != null) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < mac.length; i++) { - sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "")); - } - macs.add(sb.toString()); - } - } - } catch (Exception e) { - e.printStackTrace(); - } +// try { +// Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); +// while (networkInterfaces.hasMoreElements()) { +// NetworkInterface networkInterface = networkInterfaces.nextElement(); +// byte[] mac = networkInterface.getHardwareAddress(); +// if (mac != null) { +// StringBuilder sb = new StringBuilder(); +// for (int i = 0; i < mac.length; i++) { +// sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "")); +// } +// macs.add(sb.toString()); +// } +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } return macs; } - public LicenseTO getLicenseTO() { - return licenseTO; - } static class ConsoleColors { /** diff --git a/servlet-core/src/main/java/tech/smartboot/servlet/plugins/session/SessionProviderImpl.java b/servlet-core/src/main/java/tech/smartboot/servlet/plugins/session/SessionProviderImpl.java index 61d0a21b..1d4a63ee 100644 --- a/servlet-core/src/main/java/tech/smartboot/servlet/plugins/session/SessionProviderImpl.java +++ b/servlet-core/src/main/java/tech/smartboot/servlet/plugins/session/SessionProviderImpl.java @@ -67,7 +67,6 @@ public HttpSessionImpl getSession(HttpServletRequestImpl request, HttpServletRes if (response.isCommitted()) { throw new IllegalStateException("response has already committed!"); } - //该sessionId生成策略缺乏安全性,后续重新设计 httpSession = new HttpSessionImpl(this, createSessionId(), request.getServletContext()) { @Override public void invalid() {