diff --git a/src/app/routes/config/layout/manage/manage.component.ts b/src/app/routes/config/layout/manage/manage.component.ts index 6a2a4d6..43ae575 100644 --- a/src/app/routes/config/layout/manage/manage.component.ts +++ b/src/app/routes/config/layout/manage/manage.component.ts @@ -241,19 +241,17 @@ export class ManageComponent implements OnInit { } convertKeys(excelData: Raw[], keysMap: Record): Target[] { return excelData.map(excelItem => { - return Object.entries(excelItem).reduce((prev: any, curt) => { - const [curtKey, curtValue] = curt; - // 更新 key - const mappedKey = keysMap[curtKey]; - if (mappedKey) { - prev[mappedKey] = curtValue; - } else { - prev[curtKey] = curtValue; + const reorderedItem: any = {}; + + // 按照keysMap中定义的顺序重建对象 + Object.entries(keysMap).forEach(([originalKey, newKey]) => { + if (excelItem.hasOwnProperty(originalKey)) { + reorderedItem[newKey] = excelItem[originalKey]; } + }); - return prev; - }, {}); - }) + return reorderedItem; + }); } mockData={ diff --git a/src/app/routes/config/service/https/notice.service.ts b/src/app/routes/config/service/https/notice.service.ts index 0ff13e1..42510e7 100644 --- a/src/app/routes/config/service/https/notice.service.ts +++ b/src/app/routes/config/service/https/notice.service.ts @@ -213,7 +213,7 @@ export class NoticeService { // 400000 // ] // } - const url = '/ditingEngine/diting/global/whitelist_add'; + const url = '/ditingEngine/diting/global/whitelist_add/'; return this.httpService.post(url,{}, params); } @@ -239,4 +239,61 @@ export class NoticeService { const url = '/ditingEngine/diting/global/whitelist_add'; return this.httpService.post(url,{}, params); } + + // 添加白名单灰名单默认类型 + getDefaultRule(){ + // { + // "white_list": { + // "ip": [ + // 400000, + // 400001 + // ], + // "account": [ + // 400000, + // 400001 + // ], + // "interface": [ + // 400000, + // 400001 + // ], + // "menu": [ + // 400000, + // 400001 + // ] + // }, + // "grey_list": { + // "ip": [ + // 400000, + // 400001 + // ], + // "account": [ + // 400000, + // 400001 + // ], + // "interface": [ + // 400000, + // 400001 + // ], + // "menu": [ + // 400000, + // 400001 + // ] + // } + // } + const url = '/uebaMetricsAnalysis/ueba_metrics/get_default_rule/'; + return this.httpService.get(url); + } + + // 写审计日志 + writeAuditlog(param){ + // { + // "action":"add whitelist", + // "params":{ + // "name":"xx", + // "adg":21 + // } + // } + const url = '/uebaMetricsAnalysis/ueba_metrics/write_audit_log/'; + return this.httpService.post(url,{},param); + } }