diff --git a/src/modules/network_element/controller/ne_license.go b/src/modules/network_element/controller/ne_license.go index 9c171e8e..d503b8db 100644 --- a/src/modules/network_element/controller/ne_license.go +++ b/src/modules/network_element/controller/ne_license.go @@ -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)