优化代码

This commit is contained in:
刘祥超
2023-08-08 14:17:16 +08:00
parent 22aca2e80c
commit 5db14ec84a
58 changed files with 159 additions and 125 deletions

View File

@@ -31,7 +31,7 @@ func (this *ExportDownloadAction) RunGet(params struct {
if ok {
this.AddHeader("Content-Disposition", "attachment; filename=\"WAF-"+types.String(params.PolicyId)+".json\";")
this.AddHeader("Content-Length", strconv.Itoa(len(data)))
this.Write(data)
_, _ = this.Write(data)
} else {
this.WriteString("找不到要导出的内容")
return

View File

@@ -52,6 +52,10 @@ func (this *SortSetsAction) RunPost(params struct {
FirewallRuleGroupId: params.GroupId,
FirewallRuleSetsJSON: newRefsJSON,
})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}