increase the request timeout in frontend if the timeout of requesting third-party exchange rates api exceeds the default time

This commit is contained in:
MaysWind
2024-11-16 21:13:37 +08:00
parent f554fdefd3
commit 65a92042d6
4 changed files with 32 additions and 6 deletions
+4
View File
@@ -103,3 +103,7 @@ export function getAmapApiExternalProxyUrl() {
export function getAmapApplicationSecret() {
return getServerSetting('amas');
}
export function getExchangeRatesRequestTimeout() {
return getServerSetting('errt');
}
+4 -2
View File
@@ -9,7 +9,8 @@ import {
import {
getGoogleMapAPIKey,
getBaiduMapAK,
getAmapApplicationKey
getAmapApplicationKey,
getExchangeRatesRequestTimeout
} from './server_settings.js';
import { getTimezoneOffsetMinutes } from './datetime.js';
import { generateRandomUUID } from './misc.js';
@@ -619,7 +620,8 @@ export default {
},
getLatestExchangeRates: ({ ignoreError }) => {
return axios.get('v1/exchange_rates/latest.json', {
ignoreError: !!ignoreError
ignoreError: !!ignoreError,
timeout: getExchangeRatesRequestTimeout() || apiConstants.defaultTimeout
});
},
generateQrCodeUrl: (qrCodeName) => {