This commit is contained in:
2026-02-22 14:31:06 +08:00
parent d88178458d
commit f8f647c12a
13 changed files with 518 additions and 529 deletions

View File

@@ -14,6 +14,7 @@ import (
"os"
"path"
"path/filepath"
"slices"
"sort"
"strconv"
"strings"
@@ -135,13 +136,7 @@ func (l *Licence) VerifyLicence(licName string) bool {
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// 检查机器码是否存在授权列表中
func (l *Licence) ValidMachineCode(code string) bool {
result := false
for _, c := range l.MachineCodes {
if c == code {
result = true
break
}
}
result := slices.Contains(l.MachineCodes, code)
return result
}
@@ -265,7 +260,7 @@ func getMacAddrs() []string {
if err != nil {
return macs
}
for i := 0; i < len(netfaces); i++ {
for i := range netfaces {
if (netfaces[i].Flags&net.FlagUp) != 0 && (netfaces[i].Flags&net.FlagLoopback) == 0 {
addrs, _ := netfaces[i].Addrs()
for _, address := range addrs {