fix: 网元授权检查状态失败不更新许可证序列号
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user