Commit 5dbc7aa4 authored by 赵啸非's avatar 赵啸非

添加门户license验证

parent df5ca878
......@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.LinkedHashSet;
/**
* 操作加密授权信息
......@@ -66,9 +67,12 @@ public class CipherUtil {
StringBuilder sb = new StringBuilder();
try {
String macAddress = NetUtil.getLocalMacAddress();
InetAddress localHost = InetAddress.getLocalHost();
sb.append("mac=").append(macAddress).append("&ip=").append(localHost.getHostAddress());
log.info("macAddress:{} IP:{},HostName:{}", macAddress, localHost.getHostAddress(), localHost.getHostName());
// NetUtil.getLocalhost().
LinkedHashSet<String> ipv4 = NetUtil.localIpv4s();
// InetAddress localHost = InetAddress.getLocalHost();
sb.append("mac=").append(macAddress).append("&ip=").append(NetUtil.getLocalhost().getHostAddress());
// log.info("macAddress:{} IP:{},HostName:{}", macAddress, localHost.getHostAddress(), localHost.getHostName());
} catch (Exception e) {
log.error("获取网卡信息失败", e);
......@@ -195,12 +199,12 @@ public class CipherUtil {
public static void main(String[] args) throws UnknownHostException {
String macAddress = NetUtil.getMacAddress(InetAddress.getLocalHost());
String macAddress = NetUtil.getLocalMacAddress();
System.out.println(macAddress);
InetAddress localHost = InetAddress.getLocalHost();
System.out.println("IP:" + localHost.getHostAddress());
System.out.println("IP:" + NetUtil.getLocalhost().getHostAddress());
System.out.println("HostName:" + localHost.getHostName());
System.out.println(CipherUtil.getApplicationInfo());
......
......@@ -48,5 +48,5 @@ sys:
pub: /home/license/license.pub
log: /home/license
license:
enable: false
enable: true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment