From 4d02e95baf87c187f01b9601ec299ba73b1cc0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E5=9C=86=E5=9C=86?= Date: Thu, 28 Apr 2022 11:48:48 +0800 Subject: [PATCH] fix: test history add error --- .../app/pages/api/test/history/api-test-history.component.ts | 2 +- .../browser/src/app/shared/services/api-test/api-test.utils.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/workbench/browser/src/app/pages/api/test/history/api-test-history.component.ts b/src/workbench/browser/src/app/pages/api/test/history/api-test-history.component.ts index c24908d4b..f1db9f1b5 100644 --- a/src/workbench/browser/src/app/pages/api/test/history/api-test-history.component.ts +++ b/src/workbench/browser/src/app/pages/api/test/history/api-test-history.component.ts @@ -140,6 +140,6 @@ export class ApiTestHistoryComponent implements OnInit { private parseItem(item) { item.codeClass = this.apiTest.getHTTPStatus(item.response.statusCode).fontClass; - item.testTime = formatDate(item.createdAt, 'YYYY-MM-dd HH:mm:ss', this.locale); + item.testTime = formatDate(item.createdAt||new Date(), 'YYYY-MM-dd HH:mm:ss', this.locale); } } diff --git a/src/workbench/browser/src/app/shared/services/api-test/api-test.utils.ts b/src/workbench/browser/src/app/shared/services/api-test/api-test.utils.ts index 9f1c12721..120bcb1ba 100644 --- a/src/workbench/browser/src/app/shared/services/api-test/api-test.utils.ts +++ b/src/workbench/browser/src/app/shared/services/api-test/api-test.utils.ts @@ -151,6 +151,5 @@ export const eoFormatResponseData = ({type,report, history, id }) => { value: val.value, })); } - console.log(JSON.stringify(result)) return result; };