fix: 网元激活申请码提取两行中的激活码
This commit is contained in:
@@ -136,7 +136,13 @@ func (r *NeLicense) ReadLicenseInfo(neLicense model.NeLicense) (string, string)
|
||||
if err = sftpClient.CopyFileRemoteToLocal(nePath+"/system.ini", omcPath+"/system.ini"); err == nil {
|
||||
licensePath = omcPath + "/system.ini"
|
||||
}
|
||||
return strings.TrimSpace(string(bytes)), licensePath
|
||||
|
||||
activationRequestCode := string(bytes)
|
||||
parts := strings.SplitAfter(string(bytes), "\n")
|
||||
if len(parts) > 1 {
|
||||
activationRequestCode = parts[1] // 获取 \n 后的内容
|
||||
}
|
||||
return strings.TrimSpace(activationRequestCode), licensePath
|
||||
}
|
||||
|
||||
// UploadLicense 授权文件上传到网元主机
|
||||
|
||||
Reference in New Issue
Block a user