fix: 网元授权状态检查无连接时数据更新
This commit is contained in:
@@ -191,7 +191,6 @@ func (s *NeLicenseController) State(c *gin.Context) {
|
|||||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "neLicense.noData")))
|
c.JSON(200, result.ErrMsg(i18n.TKey(language, "neLicense.noData")))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
neLicense.Status = "0"
|
|
||||||
|
|
||||||
// 查询网元获取IP获取网元状态
|
// 查询网元获取IP获取网元状态
|
||||||
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID(neLicense.NeType, neLicense.NeId)
|
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID(neLicense.NeType, neLicense.NeId)
|
||||||
@@ -203,15 +202,20 @@ func (s *NeLicenseController) State(c *gin.Context) {
|
|||||||
neLicense.SerialNum = fmt.Sprint(neState["sn"])
|
neLicense.SerialNum = fmt.Sprint(neState["sn"])
|
||||||
neLicense.ExpiryDate = fmt.Sprint(neState["expire"])
|
neLicense.ExpiryDate = fmt.Sprint(neState["expire"])
|
||||||
neLicense.Status = "1"
|
neLicense.Status = "1"
|
||||||
|
} 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)
|
||||||
|
|
||||||
if neLicense.Status == "1" {
|
if neLicense.Status == "1" {
|
||||||
code, licensePath := s.neLicenseService.ReadLicenseInfo(neLicense)
|
|
||||||
neLicense.ActivationRequestCode = code
|
|
||||||
neLicense.LicensePath = licensePath
|
|
||||||
neLicense.UpdateBy = ctx.LoginUserToUserName(c)
|
|
||||||
s.neLicenseService.Update(neLicense)
|
|
||||||
c.JSON(200, result.OkData(map[string]string{
|
c.JSON(200, result.OkData(map[string]string{
|
||||||
"sn": neLicense.SerialNum,
|
"sn": neLicense.SerialNum,
|
||||||
"expire": neLicense.ExpiryDate,
|
"expire": neLicense.ExpiryDate,
|
||||||
|
|||||||
Reference in New Issue
Block a user