diff --git a/ui/src/services/reportRequest/index.ts b/ui/src/services/reportRequest/index.ts index e63058cb2..5ee8d4e8c 100644 --- a/ui/src/services/reportRequest/index.ts +++ b/ui/src/services/reportRequest/index.ts @@ -38,9 +38,6 @@ type ReportMapType = { [T: string]: { resourceType: ResourceType; eventType: EventType }; }; -const REPORT_URL = 'http://openwebapi.test.alipay.net/api/web/oceanbase/report'; -// const queryUrl = 'http://openwebapi.test.alipay.net/api/web/oceanbase/query'; -const REPORT_COMPONENT = 'oceanbase-dashboard'; export const REPORT_PARAMS_MAP: ReportMapType = { // polling polling: { @@ -143,7 +140,7 @@ export async function reportData({ }: ReportDataParms): Promise { const appInfo = await getAppInfoFromStorage(); - return await request(REPORT_URL, { + return await request(`${appInfo.reportHost}/api/web/oceanbase/report`, { method: 'POST', data: { content: JSON.stringify({ @@ -152,7 +149,7 @@ export async function reportData({ version: appInfo.version, body: data, }), - component: REPORT_COMPONENT, + component: appInfo.appName, }, }); } diff --git a/ui/src/services/typings.d.ts b/ui/src/services/typings.d.ts index 658bdbed0..ca6890bd9 100644 --- a/ui/src/services/typings.d.ts +++ b/ui/src/services/typings.d.ts @@ -12,6 +12,7 @@ declare namespace API { publicKey: string; reportStatistics: boolean; version: string; + reportHost: string; }; type SysStatisticsData = { diff --git a/ui/src/utils/helper.ts b/ui/src/utils/helper.ts index b3a77cf80..d41dd2aca 100644 --- a/ui/src/utils/helper.ts +++ b/ui/src/utils/helper.ts @@ -93,9 +93,7 @@ export const getAppInfoFromStorage = async (): Promise => { appInfo = (await getAppInfo()).data; } return appInfo; - }catch(err){ - throw new Error(err) - } + } catch (err) {} }; export const isReportTimeExpired = (lastTimestamp: number): boolean => {