修正因为没有选择线路而导致创建和修改节点的问题

This commit is contained in:
GoEdgeLab
2020-11-21 22:30:40 +08:00
parent da795cfdd7
commit 9f11d10311
2 changed files with 13 additions and 9 deletions

View File

@@ -95,10 +95,12 @@ func (this *CreateNodeAction) RunPost(params struct {
}
dnsRouteCodes := []string{}
err := json.Unmarshal(params.DnsRoutesJSON, &dnsRouteCodes)
if err != nil {
this.ErrorPage(err)
return
if len(params.DnsRoutesJSON) > 0 {
err := json.Unmarshal(params.DnsRoutesJSON, &dnsRouteCodes)
if err != nil {
this.ErrorPage(err)
return
}
}
// TODO 检查登录授权