增加获取序列号的功能

This commit is contained in:
季圣华
2020-09-01 23:15:03 +08:00
parent e3aa35bfc3
commit 92a4a79f40
3 changed files with 197 additions and 1 deletions

View File

@@ -4,8 +4,10 @@ import com.gitee.starblues.integration.application.PluginApplication;
import com.gitee.starblues.integration.operator.PluginOperator;
import com.gitee.starblues.integration.operator.module.PluginInfo;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ComputerInfo;
import com.jsh.erp.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -245,4 +247,22 @@ public class PluginController {
}
}
/**
* 获取加密后的mac
* @return
*/
@GetMapping("/getMacWithSecret")
public BaseResponseInfo getMacWithSecret(){
BaseResponseInfo res = new BaseResponseInfo();
try {
String mac = ComputerInfo.getMacAddress();
res.code = 200;
res.data = DigestUtils.md5DigestAsHex(mac.getBytes());
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
}