From 90a1c1b81c40a9199d15f9e4f65828400f801b64 Mon Sep 17 00:00:00 2001 From: Yohann0617 <852221040@qq.com> Date: Wed, 3 Apr 2024 22:47:24 +0800 Subject: [PATCH] update --- .../select/business/impl/ProxyIpBusinessImpl.java | 7 +++---- .../src/main/resources/static/proxyIp.html | 12 +++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/foreign-server/src/main/java/com/proxyip/select/business/impl/ProxyIpBusinessImpl.java b/foreign-server/src/main/java/com/proxyip/select/business/impl/ProxyIpBusinessImpl.java index b3021ca..72ee87f 100644 --- a/foreign-server/src/main/java/com/proxyip/select/business/impl/ProxyIpBusinessImpl.java +++ b/foreign-server/src/main/java/com/proxyip/select/business/impl/ProxyIpBusinessImpl.java @@ -22,6 +22,7 @@ import java.time.LocalDateTime; import java.util.Collections; import java.util.List; +import java.util.Locale; import java.util.Optional; import java.util.stream.Collectors; @@ -82,8 +83,7 @@ public void rmSingleDnsRecord(RmSingleDnsRecordParams params) { @Override public void addSingleDnsRecord(AddSingleDnsRecordParams params) { Optional.ofNullable(proxyIpService.getById(params.getId())).ifPresent(proxyIp -> { - String prefix = EnumUtils.getEnumByCode(CountryEnum.class, proxyIp.getCountry()).getLowCode() + "." - + cloudflareCfg.getProxyDomainPrefix(); + String prefix = proxyIp.getCountry().toLowerCase(Locale.ROOT) + "." + cloudflareCfg.getProxyDomainPrefix(); apiService.addCfDnsRecords( prefix, proxyIp.getIp(), @@ -102,8 +102,7 @@ public void addDnsRecordsBatch(AddDnsRecordsBatchParams params) { Optional.ofNullable(proxyIpService.listByIds(params.getIds())) .filter(CommonUtils::isNotEmpty).ifPresent(list -> { list.parallelStream().forEach(proxyIp -> { - String prefix = EnumUtils.getEnumByCode(CountryEnum.class, proxyIp.getCountry()).getLowCode() + "." - + cloudflareCfg.getProxyDomainPrefix(); + String prefix = proxyIp.getCountry().toLowerCase(Locale.ROOT) + "." + cloudflareCfg.getProxyDomainPrefix(); apiService.addCfDnsRecords( prefix, proxyIp.getIp(), diff --git a/foreign-server/src/main/resources/static/proxyIp.html b/foreign-server/src/main/resources/static/proxyIp.html index 5046a64..39001f4 100644 --- a/foreign-server/src/main/resources/static/proxyIp.html +++ b/foreign-server/src/main/resources/static/proxyIp.html @@ -198,7 +198,7 @@

代理IP列表

v-model="ipInfoParams" class="input-with-select" style="margin-top: 15px;"> - + @@ -236,10 +236,12 @@

代理IP列表

{{ scope.row.createTime }} - + @@ -296,8 +298,8 @@

代理IP列表

}) .catch(error => console.error('Error searching data:', error)); }, - getIpInfo() { - axios.post(`${this.apiUrl}/proxyIp/getIpInfo`, {ip: this.ipInfoParams}) + getIpInfo(ip) { + axios.post(`${this.apiUrl}/proxyIp/getIpInfo`, {ip: ip}) .then(response => { const responseData = JSON.parse(response.data.data); @@ -305,7 +307,7 @@

代理IP列表

for (const key in responseData) { formattedData += `| "${key}" : "${responseData[key]}"\n`; } - this.$alert(formattedData, 'IP:' + this.ipInfoParams, { + this.$alert(formattedData, 'IP:' + ip+' 信息', { confirmButtonText: '确定', dangerouslyUseHTMLString: true, // 添加此行以允许 HTML 字符串 callback: action => {