From 1af76cdc0c04613e6061cebb7f1412e3b7af7d4d Mon Sep 17 00:00:00 2001
From: Wang YiHang <3060234389@qq.com>
Date: Thu, 5 Sep 2024 19:27:43 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=88=97=E8=A1=A8=E5=87=BA?=
=?UTF-8?q?=E6=9D=A5=E4=BA=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/workspace.xml | 30 +++++++++++++++++--
.../market/config/MobileLocationConfig.java | 15 +++++-----
2 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 9e329e8..c4adf3c 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,6 +5,10 @@
+
+
+
+
@@ -74,7 +78,7 @@
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "MavenSettings",
+ "settings.editor.selected.configurable": "reference.settings.project.maven.repository.indices",
"spring.configuration.checksum": "647853898192e405c7aff8ecac5564ea",
"vue.rearranger.settings.migration": "true"
}
@@ -96,6 +100,7 @@
+
@@ -169,7 +174,12 @@
-
+
+
+
+
+
+
1724047244829
@@ -360,7 +370,21 @@
1725412228813
-
+
+ 1725434075951
+
+
+
+ 1725434075951
+
+
+ 1725441635174
+
+
+
+ 1725441635174
+
+
diff --git a/cloud-market-common/src/main/java/com/muyu/market/config/MobileLocationConfig.java b/cloud-market-common/src/main/java/com/muyu/market/config/MobileLocationConfig.java
index 8aab5a0..e0ceb07 100644
--- a/cloud-market-common/src/main/java/com/muyu/market/config/MobileLocationConfig.java
+++ b/cloud-market-common/src/main/java/com/muyu/market/config/MobileLocationConfig.java
@@ -31,7 +31,7 @@ public class MobileLocationConfig {
params.put("phone", mobile);
params.put("key", API_KEY);
String queryParams = urlencode(params);
-
+ String msg = null;
String response = doGet(API_URL, queryParams);
try {
JSONObject jsonObject = JSONObject.fromObject(response);
@@ -41,19 +41,20 @@ public class MobileLocationConfig {
JSONObject result = jsonObject.getJSONObject("result");
- System.out.printf("省份:%s%n", result.getString("province"));
- System.out.printf("城市:%s%n", result.getString("city"));
- System.out.printf("区号:%s%n", result.getString("areacode"));
- System.out.printf("邮编:%s%n", result.getString("zip"));
+ System.out.printf("省份:%s%n" , result.getString("province"));
+ System.out.printf("城市:%s%n" , result.getString("city"));
+ System.out.printf("区号:%s%n" , result.getString("areacode"));
+ System.out.printf("邮编:%s%n" , result.getString("zip"));
System.out.printf("运营商:%s%n", result.getString("company"));
-
+
+ msg = jsonObject.getString("reason");
} else {
System.out.println("调用接口失败:" + jsonObject.getString("reason"));
}
} catch (Exception e) {
e.printStackTrace();
}
- return response;
+ return msg;
}
/**