|
@@ -273,20 +273,20 @@ func (s *wafLogService) SmartExportWafLog(ctx context.Context, req adminApi.Expo
|
|
|
exportType := excel.SmartExport(count, 200)
|
|
|
|
|
|
// 3. 设置Excel表头映射
|
|
|
- headers := []string{"name", "request_ip", "host_id", "rule_id", "api_name", "addr_backend_list", "allow_and_deny_ips", "domain", "comment", "custom_host", "expose_addr", "created_at"}
|
|
|
+ headers := []string{"name", "request_ip", "host_id", "rule_id", "api_name", "addr_backend_list", "allow_and_deny_ips", "domain", "custom_host", "expose_addr", "comment", "created_at"}
|
|
|
headerMap := map[string]string{
|
|
|
"name": "用户名",
|
|
|
"request_ip": "请求IP",
|
|
|
- "host_id": "主机ID",
|
|
|
+ "host_id": "实例ID",
|
|
|
"rule_id": "规则ID",
|
|
|
- "api_name": "API名称",
|
|
|
+ "api_name": "操作名称",
|
|
|
"addr_backend_list": "后端地址",
|
|
|
"allow_and_deny_ips": "黑白名单",
|
|
|
"domain": "域名",
|
|
|
- "comment": "备注",
|
|
|
"custom_host": "回源地址",
|
|
|
"expose_addr": "暴露地址",
|
|
|
- "created_at": "创建时间",
|
|
|
+ "comment": "备注",
|
|
|
+ "created_at": "操作时间",
|
|
|
}
|
|
|
|
|
|
// 4. 创建Excel生成器
|
|
@@ -496,6 +496,12 @@ func (s *wafLogService) convertRawDataToExportResults(ctx context.Context, rawDa
|
|
|
ruleIds = []int64{int64(v.RuleId)}
|
|
|
}
|
|
|
|
|
|
+ if cleanedData.IsHttps == 1 {
|
|
|
+ for i := range exposeAddr {
|
|
|
+ exposeAddr[i] = "https://" + exposeAddr[i]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 构造结果,代码更清晰
|
|
|
res = append(res, adminApi.ExportWafLogRes{
|
|
|
Name: v.Name,
|