From 9957dc2a279460df8353c9e30c2f5a9729922d7a Mon Sep 17 00:00:00 2001 From: hy001 Date: Thu, 25 Jun 2026 17:10:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B1=87=E7=8E=87=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E9=9D=9E=E6=B3=95=E5=9B=BD=E5=AE=B6=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inner/service/impl/PayCountryClientServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/impl/PayCountryClientServiceImpl.java b/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/impl/PayCountryClientServiceImpl.java index 183e652c..d7202eb6 100644 --- a/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/impl/PayCountryClientServiceImpl.java +++ b/rc-service/rc-service-order/order-inner-endpoint/src/main/java/com/red/circle/order/inner/service/impl/PayCountryClientServiceImpl.java @@ -358,9 +358,13 @@ public class PayCountryClientServiceImpl implements PayCountryClientService { if (Objects.isNull(country) || StringUtils.isBlank(country.getAlphaTwo())) { return ""; } + String region = country.getAlphaTwo().trim().toUpperCase(Locale.ROOT); + if (region.length() != 2 || !region.chars().allMatch(ch -> ch >= 'A' && ch <= 'Z')) { + return ""; + } try { Locale locale = new Locale.Builder() - .setRegion(country.getAlphaTwo().trim().toUpperCase(Locale.ROOT)) + .setRegion(region) .build(); return Currency.getInstance(locale).getCurrencyCode(); } catch (IllegalArgumentException | MissingResourceException e) {