Commit 16ec5d61 by admin

修改了转链接部分的截取

parent d7887322
......@@ -524,7 +524,9 @@ public class ExcelReadAndWrite {
if (null != l.getUrl()) {
if (l.getUrl().startsWith("https://mp.weixin.qq.com/s?src")
|| l.getUrl().startsWith("http://mp.weixin.qq.com/s?src")) {
urls.add(l.getUrl());
String demoUrl=l.getUrl().replaceAll("&key=[\\s\\S]+", "");
l.setUrl(demoUrl);
urls.add(demoUrl);
log.info(l);
}
} else {
......@@ -553,10 +555,10 @@ public class ExcelReadAndWrite {
continue;
}
try {
if (null != w.getUrl() && w.getUrl().startsWith("https://mp.weixin.qq.com/s")
|| w.getUrl().startsWith("http://mp.weixin.qq.com/s")) {
if (null != w.getUrl() && w.getUrl().startsWith("http://mp.weixin.qq.com/s")
|| w.getUrl().startsWith("https://mp.weixin.qq.com/s")) {
if (map.get(w.getUrl()) != null) {
w.setGetUrl(urlRedirect(map.get(w.getUrl())));
w.setGetUrl(map.get(w.getUrl()));
}
} else {
if (w.getUrl() == null) {
......
......@@ -22,9 +22,8 @@ public class ReaderExcel {
private final static Log log = LogFactory.getLog(ReaderExcel.class);
public static void main(String[] args) throws IOException {
for (Weixin w : getExcel("C:\\Users\\admin\\Desktop/微信-山西三维0419.xlsx")) {
System.out.println(w);
}
System.out.println("https://mp.weixin.qq.com/s?src=11&timestamp=1525385592&ver=855&signature=t61muuTJKorCLU9B6F9khlfr3ezct6GGh-Moxq*9b4RZxgQnHSpElHV9CYCi2YnSA3nOz2*a04k6R9iHOGzctg1KS9Bgx3jelhxEi5NzmXHmhglHbp8Tjf5*rKEFilpi&new=1&key=95dc4253938e3c7ba33e1ff6f7363608ab00e37f99c7f7ff7e7cb4e5b1a6ce70df92e7de80d56d237ffe33cd15ffcb0a80bc0d064ece8d169c6e38960f0d44e359a01cd7bcb987a08b3de1a19e94eb06&uin=NTk1NjM2Nzg3&key=b97b0a94956e0cb2b01167441267dc09f5e79cb852c323792d0040c1988b0c39913e23a2e43b0bccef725d2843e0da0d81c5164338260e6b932f25085936eec21b0e71ca66cd78582d2411b4737cb644&uin=MzM3MTk2NzAxNA%3D%3D".replaceAll("&key=[\\s\\S]+", ""));
}
public static List<Weixin> getExcel(String url) throws IOException {
......
......@@ -20,7 +20,7 @@ import com.zw.entity.NewsResult;
import sendmail.SendMailUtil;
//@Component
@Component
public class PushFinanceByTime extends Thread {
private static final Log log = LogFactory.getLog(PushFinanceByTime.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment