mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	安全设置增加允许访问的国家地区、省份、是否局域网访问
This commit is contained in:
		@@ -1,6 +1,9 @@
 | 
			
		||||
package utils
 | 
			
		||||
 | 
			
		||||
import "strings"
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/iwind/TeaGo/types"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// format address
 | 
			
		||||
func FormatAddress(addr string) string {
 | 
			
		||||
@@ -13,3 +16,16 @@ func FormatAddress(addr string) string {
 | 
			
		||||
	addr = strings.TrimSpace(addr)
 | 
			
		||||
	return addr
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 分割数字
 | 
			
		||||
func SplitNumbers(numbers string) (result []int64) {
 | 
			
		||||
	if len(numbers) == 0 {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	pieces := strings.Split(numbers, ",")
 | 
			
		||||
	for _, piece := range pieces {
 | 
			
		||||
		number := types.Int64(strings.TrimSpace(piece))
 | 
			
		||||
		result = append(result, number)
 | 
			
		||||
	}
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user