修改控制器及新增城市功能

This commit is contained in:
songjinsheng
2022-06-24 10:28:33 +08:00
parent 11b8a3db44
commit f52a876226
14 changed files with 289 additions and 8 deletions

View File

@ -18,7 +18,7 @@ public class WeatherUtils
//buffer用于接受返回的字符
StringBuffer buffer = new StringBuffer();
try {
//建立URL把请求地址给补全其中urlencode方法用于把params里的参数给取出来
//拼接url连接
URL url = new URL(requestUrl+"?"+urlencode(params));
//打开http连接
HttpURLConnection httpUrlConn = (HttpURLConnection) url.openConnection();
@ -40,7 +40,6 @@ public class WeatherUtils
bufferedReader.close();
inputStreamReader.close();
inputStream.close();
inputStream = null;
//断开连接
httpUrlConn.disconnect();