fix: 网元授权检查状态失败不更新许可证序列号

This commit is contained in:
TsMask
2024-05-17 18:06:01 +08:00
parent 8b64dfa10d
commit fe09fa4ed5

View File

@@ -199,19 +199,17 @@ func (s *NeLicenseController) State(c *gin.Context) {
return
}
if neState, err := neService.NeState(neInfo); err == nil {
neLicense.Status = "1"
neLicense.SerialNum = fmt.Sprint(neState["sn"])
neLicense.ExpiryDate = fmt.Sprint(neState["expire"])
neLicense.Status = "1"
code, licensePath := s.neLicenseService.ReadLicenseInfo(neLicense)
neLicense.ActivationRequestCode = code
neLicense.LicensePath = licensePath
} else {
neLicense.SerialNum = "-"
neLicense.ExpiryDate = "-"
neLicense.Status = "0"
}
// 更新授权信息
code, licensePath := s.neLicenseService.ReadLicenseInfo(neLicense)
neLicense.ActivationRequestCode = code
neLicense.LicensePath = licensePath
neLicense.UpdateBy = ctx.LoginUserToUserName(c)
s.neLicenseService.Update(neLicense)