feat: 增强地址处理逻辑,支持日本地区并优化相关测试用例

This commit is contained in:
QLHazyCoder
2026-04-26 15:59:14 +08:00
parent 6c2bec6520
commit 5271ec5b59
5 changed files with 264 additions and 13 deletions
+4
View File
@@ -12,6 +12,7 @@
FR: '/fr-address',
US: '/',
};
const MEIGUODIZHI_SUPPORTED_COUNTRIES = new Set(Object.keys(MEIGUODIZHI_PATH_BY_COUNTRY));
function createPlusCheckoutBillingExecutor(deps = {}) {
const {
@@ -75,6 +76,9 @@
if (typeof fetchImpl !== 'function') {
return null;
}
if (!MEIGUODIZHI_SUPPORTED_COUNTRIES.has(countryCode)) {
return null;
}
const path = MEIGUODIZHI_PATH_BY_COUNTRY[countryCode] || MEIGUODIZHI_PATH_BY_COUNTRY.DE;
const city = normalizeText(fallbackSeed?.fallback?.city || fallbackSeed?.query || '');
const response = await fetchImpl(MEIGUODIZHI_ADDRESS_ENDPOINT, {