update
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user