fix: 网元激活码多行行内容提取
This commit is contained in:
@@ -138,9 +138,9 @@ func (r *NeLicense) ReadLicenseInfo(neLicense model.NeLicense) (string, string)
|
||||
}
|
||||
|
||||
activationRequestCode := string(bytes)
|
||||
parts := strings.SplitAfter(string(bytes), "\n")
|
||||
if len(parts) > 1 {
|
||||
activationRequestCode = parts[1] // 获取 \n 后的内容
|
||||
parts := strings.Split(activationRequestCode, "\n")
|
||||
if len(parts) > 1 && strings.HasPrefix(parts[0], "SN") {
|
||||
activationRequestCode = parts[1] // 获取第二行内容
|
||||
}
|
||||
return strings.TrimSpace(activationRequestCode), licensePath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user