diff --git a/docs/license_db.sql b/docs/license_db.sql index 32631f8..4156b63 100644 --- a/docs/license_db.sql +++ b/docs/license_db.sql @@ -46,6 +46,8 @@ CREATE TABLE t_license_record ( cpu_serial VARCHAR(200) COMMENT '绑定CPU序列号', main_board_serial VARCHAR(200) COMMENT '绑定主板序列号', description VARCHAR(500) COMMENT '证书描述', + license_content LONGTEXT COMMENT 'License证书文件内容(Base64编码)', + public_key_content LONGTEXT COMMENT '公钥文件内容(Base64编码)', status INT NOT NULL DEFAULT 0 COMMENT '状态: 0-正常, 1-到期, 2-冻结', create_time DATETIME COMMENT '创建时间', update_time DATETIME COMMENT '更新时间', diff --git a/licence-server/src/main/java/com/lcz/licence/controller/LicenseController.java b/licence-server/src/main/java/com/lcz/licence/controller/LicenseController.java index ed05afe..049638d 100644 --- a/licence-server/src/main/java/com/lcz/licence/controller/LicenseController.java +++ b/licence-server/src/main/java/com/lcz/licence/controller/LicenseController.java @@ -11,12 +11,11 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.OutputStream; +import java.io.*; import java.util.HashMap; import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; /** * @author lcz @@ -121,4 +120,48 @@ public class LicenseController { } } + /** + * 打包下载证书和公钥文件 + */ + @GetMapping("/downloadZip") + public void downloadZip(@RequestParam(value = "name", required = false, defaultValue = "license") String packageName, HttpServletResponse response) throws IOException { + File licenseFile = new File(keyStorePath + "license.lic"); + File publicKeyFile = new File(keyStorePath + "publicCerts.keystore"); + + if (!licenseFile.exists()) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "license.lic 文件不存在"); + return; + } + if (!publicKeyFile.exists()) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "publicCerts.keystore 文件不存在"); + return; + } + + response.setContentType("application/zip"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + packageName + ".zip\""); + + try (ZipOutputStream zos = new ZipOutputStream(response.getOutputStream()); + FileInputStream licenseFis = new FileInputStream(licenseFile); + FileInputStream publicKeyFis = new FileInputStream(publicKeyFile)) { + + // 添加 license.lic 到 zip + zos.putNextEntry(new ZipEntry("license.lic")); + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = licenseFis.read(buffer)) != -1) { + zos.write(buffer, 0, bytesRead); + } + zos.closeEntry(); + + // 添加 publicCerts.keystore 到 zip + zos.putNextEntry(new ZipEntry("publicCerts.keystore")); + while ((bytesRead = publicKeyFis.read(buffer)) != -1) { + zos.write(buffer, 0, bytesRead); + } + zos.closeEntry(); + } catch (IOException e) { + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "打包下载失败"); + } + } + } diff --git a/licence-server/src/main/java/com/lcz/licence/controller/manager/CustomerController.java b/licence-server/src/main/java/com/lcz/licence/controller/manager/CustomerController.java index db2b119..b5bd831 100644 --- a/licence-server/src/main/java/com/lcz/licence/controller/manager/CustomerController.java +++ b/licence-server/src/main/java/com/lcz/licence/controller/manager/CustomerController.java @@ -2,6 +2,8 @@ package com.lcz.licence.controller.manager; import com.lcz.licence.entity.manager.Customer; import com.lcz.licence.service.manager.CustomerService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -13,12 +15,16 @@ import java.util.Map; @RequestMapping("/api/customers") public class CustomerController { + private static final Logger log = LoggerFactory.getLogger(CustomerController.class); + @Autowired private CustomerService customerService; @GetMapping public Map list(@RequestParam(required = false) String keyword) { + log.info("GET /api/customers - keyword: {}", keyword); List list = customerService.search(keyword); + log.info("GET /api/customers - 返回 {} 条数据", list.size()); Map result = new HashMap<>(); result.put("code", 200); result.put("data", list); @@ -28,22 +34,38 @@ public class CustomerController { @GetMapping("/{id}") public Map get(@PathVariable Long id) { + log.info("GET /api/customers/{}", id); Map result = new HashMap<>(); java.util.Optional optCustomer = customerService.findById(id); if (optCustomer.isPresent()) { result.put("code", 200); result.put("data", optCustomer.get()); + log.info("GET /api/customers/{} - 找到客户: {}", id, optCustomer.get().getName()); } else { result.put("code", 404); result.put("msg", "客户不存在"); + log.warn("GET /api/customers/{} - 客户不存在", id); } return result; } @PostMapping public Map save(@RequestBody Customer customer) { + log.info("POST /api/customers - 保存客户: {}", customer.getName()); Map result = new HashMap<>(); + + // 检查唯一性 + Map duplicates = customerService.checkDuplicate(customer); + if (!duplicates.isEmpty()) { + log.warn("POST /api/customers - 存在重复数据: {}", duplicates); + result.put("code", 400); + result.put("msg", "存在重复数据"); + result.put("duplicates", duplicates); + return result; + } + Customer saved = customerService.save(customer); + log.info("POST /api/customers - 保存成功, id: {}", saved.getId()); result.put("code", 200); result.put("data", saved); result.put("msg", "保存成功"); @@ -52,9 +74,22 @@ public class CustomerController { @PutMapping("/{id}") public Map update(@PathVariable Long id, @RequestBody Customer customer) { + log.info("PUT /api/customers/{} - 更新客户: {}", id, customer.getName()); Map result = new HashMap<>(); customer.setId(id); + + // 检查唯一性 + Map duplicates = customerService.checkDuplicate(customer); + if (!duplicates.isEmpty()) { + log.warn("PUT /api/customers/{} - 存在重复数据: {}", id, duplicates); + result.put("code", 400); + result.put("msg", "存在重复数据"); + result.put("duplicates", duplicates); + return result; + } + Customer saved = customerService.save(customer); + log.info("PUT /api/customers/{} - 更新成功", id); result.put("code", 200); result.put("data", saved); result.put("msg", "更新成功"); @@ -63,8 +98,10 @@ public class CustomerController { @DeleteMapping("/{id}") public Map delete(@PathVariable Long id) { + log.info("DELETE /api/customers/{}", id); Map result = new HashMap<>(); customerService.delete(id); + log.info("DELETE /api/customers/{} - 删除成功", id); result.put("code", 200); result.put("msg", "删除成功"); return result; diff --git a/licence-server/src/main/java/com/lcz/licence/controller/manager/LicenseRecordController.java b/licence-server/src/main/java/com/lcz/licence/controller/manager/LicenseRecordController.java index d1b3f89..052d388 100644 --- a/licence-server/src/main/java/com/lcz/licence/controller/manager/LicenseRecordController.java +++ b/licence-server/src/main/java/com/lcz/licence/controller/manager/LicenseRecordController.java @@ -2,9 +2,14 @@ package com.lcz.licence.controller.manager; import com.lcz.licence.entity.manager.LicenseRecord; import com.lcz.licence.service.manager.LicenseRecordService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Base64; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -13,12 +18,16 @@ import java.util.Map; @RequestMapping("/api/license-records") public class LicenseRecordController { + private static final Logger log = LoggerFactory.getLogger(LicenseRecordController.class); + @Autowired private LicenseRecordService licenseRecordService; @GetMapping public Map list() { + log.info("GET /api/license-records - 查询所有License记录"); List list = licenseRecordService.findAll(); + log.info("GET /api/license-records - 返回 {} 条数据", list.size()); Map result = new HashMap<>(); result.put("code", 200); result.put("data", list); @@ -28,22 +37,27 @@ public class LicenseRecordController { @GetMapping("/{id}") public Map get(@PathVariable Long id) { + log.info("GET /api/license-records/{}", id); Map result = new HashMap<>(); java.util.Optional optRecord = licenseRecordService.findById(id); if (optRecord.isPresent()) { result.put("code", 200); result.put("data", optRecord.get()); + log.info("GET /api/license-records/{} - 找到记录, subject: {}", id, optRecord.get().getSubject()); } else { result.put("code", 404); result.put("msg", "记录不存在"); + log.warn("GET /api/license-records/{} - 记录不存在", id); } return result; } @PostMapping public Map save(@RequestBody LicenseRecord record) { + log.info("POST /api/license-records - 保存License, customerId: {}, subject: {}", record.getCustomerId(), record.getSubject()); Map result = new HashMap<>(); LicenseRecord saved = licenseRecordService.save(record); + log.info("POST /api/license-records - 保存成功, id: {}", saved.getId()); result.put("code", 200); result.put("data", saved); result.put("msg", "保存成功"); @@ -52,9 +66,11 @@ public class LicenseRecordController { @PutMapping("/{id}") public Map update(@PathVariable Long id, @RequestBody LicenseRecord record) { + log.info("PUT /api/license-records/{} - 更新License", id); Map result = new HashMap<>(); record.setId(id); LicenseRecord saved = licenseRecordService.save(record); + log.info("PUT /api/license-records/{} - 更新成功", id); result.put("code", 200); result.put("data", saved); result.put("msg", "更新成功"); @@ -63,8 +79,10 @@ public class LicenseRecordController { @DeleteMapping("/{id}") public Map delete(@PathVariable Long id) { + log.info("DELETE /api/license-records/{}", id); Map result = new HashMap<>(); licenseRecordService.delete(id); + log.info("DELETE /api/license-records/{} - 删除成功", id); result.put("code", 200); result.put("msg", "删除成功"); return result; @@ -77,14 +95,17 @@ public class LicenseRecordController { */ @PostMapping("/{id}/renew") public Map renew(@PathVariable Long id, @RequestParam(defaultValue = "12") int months) { + log.info("POST /api/license-records/{}/renew - 续期 {} 个月", id, months); Map result = new HashMap<>(); boolean success = licenseRecordService.renew(id, months); if (success) { result.put("code", 200); result.put("msg", "续期成功,延长" + months + "个月"); + log.info("POST /api/license-records/{}/renew - 续期成功", id); } else { result.put("code", 404); result.put("msg", "记录不存在"); + log.warn("POST /api/license-records/{}/renew - 记录不存在", id); } return result; } @@ -94,14 +115,17 @@ public class LicenseRecordController { */ @PostMapping("/{id}/freeze") public Map freeze(@PathVariable Long id) { + log.info("POST /api/license-records/{}/freeze - 冻结", id); Map result = new HashMap<>(); boolean success = licenseRecordService.freeze(id); if (success) { result.put("code", 200); result.put("msg", "已冻结"); + log.info("POST /api/license-records/{}/freeze - 冻结成功", id); } else { result.put("code", 404); result.put("msg", "记录不存在"); + log.warn("POST /api/license-records/{}/freeze - 记录不存在", id); } return result; } @@ -111,14 +135,17 @@ public class LicenseRecordController { */ @PostMapping("/{id}/unfreeze") public Map unfreeze(@PathVariable Long id) { + log.info("POST /api/license-records/{}/unfreeze - 解冻", id); Map result = new HashMap<>(); boolean success = licenseRecordService.unfreeze(id); if (success) { result.put("code", 200); result.put("msg", "已解冻"); + log.info("POST /api/license-records/{}/unfreeze - 解冻成功", id); } else { result.put("code", 404); result.put("msg", "记录不存在"); + log.warn("POST /api/license-records/{}/unfreeze - 记录不存在", id); } return result; } @@ -128,11 +155,98 @@ public class LicenseRecordController { */ @GetMapping("/expiring") public Map expiring() { + log.info("GET /api/license-records/expiring - 查询即将到期的License"); Map result = new HashMap<>(); List list = licenseRecordService.findExpiringLicenses(); + log.info("GET /api/license-records/expiring - 返回 {} 条数据", list.size()); result.put("code", 200); result.put("data", list); result.put("total", list.size()); return result; } + + /** + * 下载License证书文件 + */ + @GetMapping("/{id}/downloadLicense") + public void downloadLicense(@PathVariable Long id, HttpServletResponse response) throws IOException { + log.info("GET /api/license-records/{}/downloadLicense - 下载License证书", id); + java.util.Optional optRecord = licenseRecordService.findById(id); + if (!optRecord.isPresent()) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "记录不存在"); + return; + } + LicenseRecord record = optRecord.get(); + if (record.getLicenseContent() == null || record.getLicenseContent().length() == 0) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "文件不存在"); + return; + } + response.setContentType("application/octet-stream"); + response.setHeader("Content-Disposition", "attachment; filename=\"license.lic\""); + byte[] bytes = Base64.getDecoder().decode(record.getLicenseContent()); + response.getOutputStream().write(bytes); + } + + /** + * 下载公钥文件 + */ + @GetMapping("/{id}/downloadPublicKey") + public void downloadPublicKey(@PathVariable Long id, HttpServletResponse response) throws IOException { + log.info("GET /api/license-records/{}/downloadPublicKey - 下载公钥文件", id); + java.util.Optional optRecord = licenseRecordService.findById(id); + if (!optRecord.isPresent()) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "记录不存在"); + return; + } + LicenseRecord record = optRecord.get(); + if (record.getPublicKeyContent() == null || record.getPublicKeyContent().length() == 0) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "文件不存在"); + return; + } + response.setContentType("application/octet-stream"); + response.setHeader("Content-Disposition", "attachment; filename=\"publicCerts.keystore\""); + byte[] bytes = Base64.getDecoder().decode(record.getPublicKeyContent()); + response.getOutputStream().write(bytes); + } + + /** + * 打包下载License和公钥文件 + */ + @GetMapping("/{id}/downloadZip") + public void downloadZip(@PathVariable Long id, HttpServletResponse response) throws IOException { + log.info("GET /api/license-records/{}/downloadZip - 打包下载", id); + java.util.Optional optRecord = licenseRecordService.findById(id); + if (!optRecord.isPresent()) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "记录不存在"); + return; + } + LicenseRecord record = optRecord.get(); + + if ((record.getLicenseContent() == null || record.getLicenseContent().length() == 0) && + (record.getPublicKeyContent() == null || record.getPublicKeyContent().length() == 0)) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "文件不存在"); + return; + } + + response.setContentType("application/zip"); + String fileName = record.getSubject() != null ? record.getSubject() : "license"; + response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + ".zip\""); + + java.util.zip.ZipOutputStream zos = new java.util.zip.ZipOutputStream(response.getOutputStream()); + + if (record.getLicenseContent() != null && record.getLicenseContent().length() > 0) { + zos.putNextEntry(new java.util.zip.ZipEntry("license.lic")); + zos.write(Base64.getDecoder().decode(record.getLicenseContent())); + zos.closeEntry(); + } + + if (record.getPublicKeyContent() != null && record.getPublicKeyContent().length() > 0) { + zos.putNextEntry(new java.util.zip.ZipEntry("publicCerts.keystore")); + zos.write(Base64.getDecoder().decode(record.getPublicKeyContent())); + zos.closeEntry(); + } + + zos.finish(); + zos.close(); + } } diff --git a/licence-server/src/main/java/com/lcz/licence/entity/manager/Customer.java b/licence-server/src/main/java/com/lcz/licence/entity/manager/Customer.java index be14e5a..f204a7a 100644 --- a/licence-server/src/main/java/com/lcz/licence/entity/manager/Customer.java +++ b/licence-server/src/main/java/com/lcz/licence/entity/manager/Customer.java @@ -1,5 +1,6 @@ package com.lcz.licence.entity.manager; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.NoArgsConstructor; import lombok.AllArgsConstructor; @@ -55,10 +56,12 @@ public class Customer { /** * 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") private Date createTime; /** * 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") private Date updateTime; } diff --git a/licence-server/src/main/java/com/lcz/licence/entity/manager/LicenseRecord.java b/licence-server/src/main/java/com/lcz/licence/entity/manager/LicenseRecord.java index c4fa1f7..3fbb924 100644 --- a/licence-server/src/main/java/com/lcz/licence/entity/manager/LicenseRecord.java +++ b/licence-server/src/main/java/com/lcz/licence/entity/manager/LicenseRecord.java @@ -1,5 +1,6 @@ package com.lcz.licence.entity.manager; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.NoArgsConstructor; import lombok.AllArgsConstructor; @@ -46,11 +47,13 @@ public class LicenseRecord { /** * License 生效时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") private Date issuedTime; /** * License 到期时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") private Date expireTime; /** @@ -93,6 +96,20 @@ public class LicenseRecord { */ private String description; + /** + * License证书文件内容(Base64编码) + */ + @Lob + @Column(columnDefinition = "LONGTEXT") + private String licenseContent; + + /** + * 公钥文件内容(Base64编码) + */ + @Lob + @Column(columnDefinition = "LONGTEXT") + private String publicKeyContent; + /** * 状态: 0-正常, 1-到期, 2-冻结 */ @@ -102,11 +119,13 @@ public class LicenseRecord { /** * 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") private Date createTime; /** * 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") private Date updateTime; public static final int STATUS_NORMAL = 0; diff --git a/licence-server/src/main/java/com/lcz/licence/repository/CustomerRepository.java b/licence-server/src/main/java/com/lcz/licence/repository/CustomerRepository.java index 9b1f30e..a28b895 100644 --- a/licence-server/src/main/java/com/lcz/licence/repository/CustomerRepository.java +++ b/licence-server/src/main/java/com/lcz/licence/repository/CustomerRepository.java @@ -10,4 +10,18 @@ import java.util.List; public interface CustomerRepository extends JpaRepository { List findByNameContaining(String name); + + List findAllByName(String name); + + List findAllByPhone(String phone); + + List findAllByEmail(String email); + + long countByEmail(String email); + + boolean existsByName(String name); + + boolean existsByPhone(String phone); + + boolean existsByEmail(String email); } diff --git a/licence-server/src/main/java/com/lcz/licence/service/manager/CustomerService.java b/licence-server/src/main/java/com/lcz/licence/service/manager/CustomerService.java index 7e77f1b..33b36ff 100644 --- a/licence-server/src/main/java/com/lcz/licence/service/manager/CustomerService.java +++ b/licence-server/src/main/java/com/lcz/licence/service/manager/CustomerService.java @@ -2,6 +2,8 @@ package com.lcz.licence.service.manager; import com.lcz.licence.entity.manager.Customer; import com.lcz.licence.repository.CustomerRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -13,35 +15,100 @@ import java.util.Optional; @Service public class CustomerService { + private static final Logger log = LoggerFactory.getLogger(CustomerService.class); + @Autowired private CustomerRepository customerRepository; public List findAll() { - return customerRepository.findAll(); + log.info("CustomerService.findAll - 查询所有客户"); + List result = customerRepository.findAll(); + log.info("CustomerService.findAll - 查询到 {} 条数据", result.size()); + return result; } public List search(String keyword) { if (keyword == null || keyword.trim().isEmpty()) { + log.info("CustomerService.search - keyword为空,执行全量查询"); return customerRepository.findAll(); } - return customerRepository.findByNameContaining(keyword); + log.info("CustomerService.search - keyword: {}", keyword); + List result = customerRepository.findByNameContaining(keyword); + log.info("CustomerService.search - 模糊查询到 {} 条数据", result.size()); + return result; } public Optional findById(Long id) { + log.info("CustomerService.findById - id: {}", id); return customerRepository.findById(id); } @Transactional public Customer save(Customer customer) { + log.info("CustomerService.save - 保存客户, name: {}, id: {}", customer.getName(), customer.getId()); if (customer.getId() == null) { customer.setCreateTime(new Date()); + log.info("CustomerService.save - 新增客户,设置创建时间"); } customer.setUpdateTime(new Date()); - return customerRepository.save(customer); + Customer saved = customerRepository.save(customer); + log.info("CustomerService.save - 保存成功, 返回id: {}", saved.getId()); + return saved; } @Transactional public void delete(Long id) { + log.info("CustomerService.delete - 删除客户, id: {}", id); customerRepository.deleteById(id); + log.info("CustomerService.delete - 删除完成"); + } + + /** + * 检查唯一性,返回重复的字段名列表 + * @param customer 待检查的客户 + * @return 重复的字段列表(name, phone, email) + */ + public java.util.Map checkDuplicate(Customer customer) { + log.info("CustomerService.checkDuplicate - 检查客户: {}, id: {}", customer.getName(), customer.getId()); + java.util.Map duplicates = new java.util.HashMap<>(); + + // 检查名称唯一性 + if (customer.getName() != null && !customer.getName().trim().isEmpty()) { + List existingList = customerRepository.findAllByName(customer.getName().trim()); + log.info("CustomerService.checkDuplicate - name查询到 {} 条数据", existingList.size()); + boolean hasDuplicate = existingList.stream() + .anyMatch(c -> !c.getId().equals(customer.getId())); + if (hasDuplicate) { + log.warn("CustomerService.checkDuplicate - 发现重复name: {}", customer.getName()); + duplicates.put("name", "客户名称已存在"); + } + } + + // 检查电话唯一性 + if (customer.getPhone() != null && !customer.getPhone().trim().isEmpty()) { + List existingList = customerRepository.findAllByPhone(customer.getPhone().trim()); + log.info("CustomerService.checkDuplicate - phone查询到 {} 条数据", existingList.size()); + boolean hasDuplicate = existingList.stream() + .anyMatch(c -> !c.getId().equals(customer.getId())); + if (hasDuplicate) { + log.warn("CustomerService.checkDuplicate - 发现重复phone: {}", customer.getPhone()); + duplicates.put("phone", "电话号码已存在"); + } + } + + // 检查邮箱唯一性 + if (customer.getEmail() != null && !customer.getEmail().trim().isEmpty()) { + List existingList = customerRepository.findAllByEmail(customer.getEmail().trim()); + log.info("CustomerService.checkDuplicate - email查询到 {} 条数据", existingList.size()); + boolean hasDuplicate = existingList.stream() + .anyMatch(c -> !c.getId().equals(customer.getId())); + if (hasDuplicate) { + log.warn("CustomerService.checkDuplicate - 发现重复email: {}", customer.getEmail()); + duplicates.put("email", "邮箱地址已存在"); + } + } + + log.info("CustomerService.checkDuplicate - 检查完成, 重复字段: {}", duplicates.keySet()); + return duplicates; } } diff --git a/licence-server/src/main/resources/static/generateLicense.html b/licence-server/src/main/resources/static/generateLicense.html index aa8b621..1631c37 100644 --- a/licence-server/src/main/resources/static/generateLicense.html +++ b/licence-server/src/main/resources/static/generateLicense.html @@ -452,6 +452,15 @@
公钥文件
+
+
+ +
+
+
打包下载
+
license.lic + publicCerts.keystore
+
+
@@ -491,6 +500,11 @@
diff --git a/sss b/sss new file mode 100644 index 0000000..ca40289 --- /dev/null +++ b/sss @@ -0,0 +1,23 @@ + +管理后台 → 客户管理列表-操作点击"生成证书" + ↓ + 跳转到 generateLicense.html?customerId=xxx + ↓ + 自动填入客户名称 + ↓ + 填入硬件信息 → 生成证书 + ↓ + 自动保存 License 记录到数据库 + ↓ + 弹出下载框 + ↓ + 回管理后台能看到新建的 License 记录 + + 重启服务后试试看。 + + 自动保存 License 记录到数据库 ,能不能把生成的两个文件存储到数据库中呀 + +打包下载 + + - 无 License:生成证书 + 编辑 + 删除 + - 有 License:续期 + 冻结/解冻 + 编辑 + 删除 + 生成证书