/**
* 格式:https://xxx?cc=7180062&org=%E.....
*
* @param url
* @param param
* @return 2022年3月20日10:20:58
*
*/
public String getURLParam(String url, String param) throws UnsupportedEncodingException {
String[] urlArray = url.split("=");
if ("cc".equals(param)) {
String cc= urlArray[2].split("&")[0];
return ecarenum;
}
if ("org".equals(param)) {
String org = urlArray[3].split("&")[0];
return URLDecoder.decode(org, "UTF-8");
}
//当url中有汉字的时候,需要用utf-8去解码,不然会乱码
if ("dd".equals(param)) {
return URLDecoder.decode(urlArray[4].split("&")[0], "UTF-8");
}
if ("ee".equals(param)) {
String reportContactEmail = urlArray[5];
return URLDecoder.decode(ee, "UTF-8");
}
return null;
}
04-27
268
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-08
2万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-07
1217
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-24
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交