增加默认路由

This commit is contained in:
bjdgyc 2021-08-13 11:33:53 +08:00
parent 5bd55d1fa8
commit 8187fb548f
3 changed files with 19 additions and 13968 deletions
server/dbdata
web

View File

@ -68,17 +68,24 @@ func SetGroup(g *Group) error {
clientDns := []ValData{}
for _, v := range g.ClientDns {
if v.Val != "" {
ip := net.ParseIP(v.Val)
if ip.String() != v.Val {
return errors.New("DNS IP 错误")
}
clientDns = append(clientDns, v)
}
}
if len(clientDns) == 0 {
return errors.New("DNS 错误")
return errors.New("必须设置一个DNS")
}
g.ClientDns = clientDns
routeInclude := []ValData{}
for _, v := range g.RouteInclude {
if v.Val != "" {
if v.Val == "all" {
continue
}
ipMask, _, err := parseIpNet(v.Val)
if err != nil {
return errors.New("RouteInclude 错误" + err.Error())

13976
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -319,7 +319,7 @@ export default {
status: 1,
allow_lan: true,
client_dns: [{val: '114.114.114.114'}],
route_include: [],
route_include: [{val: 'all', note: '默认全局代理'}],
route_exclude: [],
link_acl: [],
},