fix: License检查错误抛出到错误信息
This commit is contained in:
@@ -146,9 +146,13 @@ func (s *NeLicenseController) Code(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 更新授权码
|
||||
code, licensePath := s.neLicenseService.ReadLicenseInfo(neLicense)
|
||||
neLicense.ActivationRequestCode = code
|
||||
if licensePath != "" {
|
||||
code, licensePath, err := s.neLicenseService.ReadLicenseInfo(neLicense)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
if code != "" && licensePath != "" {
|
||||
neLicense.ActivationRequestCode = code
|
||||
neLicense.LicensePath = licensePath
|
||||
} else {
|
||||
neLicense.SerialNum = ""
|
||||
@@ -255,7 +259,11 @@ func (s *NeLicenseController) State(c *gin.Context) {
|
||||
neLicense.Status = "1"
|
||||
neLicense.SerialNum = fmt.Sprint(neState["sn"])
|
||||
neLicense.ExpiryDate = fmt.Sprint(neState["expire"])
|
||||
code, licensePath := s.neLicenseService.ReadLicenseInfo(neLicense)
|
||||
code, licensePath, err := s.neLicenseService.ReadLicenseInfo(neLicense)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
neLicense.ActivationRequestCode = code
|
||||
neLicense.LicensePath = licensePath
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user