From ad45400f25ffd88ca401466b2bcf824937d7d25f Mon Sep 17 00:00:00 2001 From: readme-bot Date: Sat, 7 Oct 2023 23:19:23 +0800 Subject: [PATCH] add client id when request --- src/middlelayers/datafetch/currencies/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/middlelayers/datafetch/currencies/index.ts b/src/middlelayers/datafetch/currencies/index.ts index fea3435..78520af 100644 --- a/src/middlelayers/datafetch/currencies/index.ts +++ b/src/middlelayers/datafetch/currencies/index.ts @@ -1,6 +1,7 @@ import _ from 'lodash' import { CurrencyRate } from '../types' import { sendHttpRequest } from '../utils/http' +import { getClientID } from '../../../utils/app' export interface CurrencyRateQuerier { listAllCurrencyRates(): Promise @@ -17,7 +18,9 @@ export class ExchangeRate implements CurrencyRateQuerier { rates: { [key: string]: number } - }>("GET", this.queryUrl + currentDate) + }>("GET", this.queryUrl + currentDate, 10000, { + "x-track3-client-id": await getClientID(), + }) if (!resp.success) { throw new Error("Failed to fetch currency rates") }