Selaa lähdekoodia

Merge remote-tracking branch 'origin/developer' into developer

zhengjinyi 2 vuotta sitten
vanhempi
commit
37269b52a0

+ 3 - 2
src/main/java/com/caimei/www/controller/unlimited/ArticleController.java

@@ -125,10 +125,11 @@ public class ArticleController extends BaseController {
         if (referer1 != null) {
             referer = referer1.get(0);
         }
+        String subReferer = referer.substring(0, 190);
         source = source(referer);
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String format = dateFormat.format(new Date());
-        articleService.insertRecord(ip,referer,source,format);
+        articleService.insertRecord(ip,subReferer,source,format);
         log.info("文章详情访问来源记录完成========》"+source);
         List<BaseLink> data = articleService.getArticleLabels().getData();
         List<ImageLink> Ads = articleService.getLastestInfoAds().getData();
@@ -232,7 +233,7 @@ public class ArticleController extends BaseController {
     }
 
     private String source(String link) {
-        if (link.contains("www.baidu.com")) {
+        if (link.contains("baidu.com")) {
             return "1";
         }
         if (link.contains("www.so.com")) {

+ 3 - 2
src/main/java/com/caimei/www/controller/unlimited/HomeController.java

@@ -65,10 +65,11 @@ public class HomeController extends BaseController {
         if (referer1 != null) {
             referer = referer1.get(0);
         }
+        String subReferer = referer.substring(0, 190);
         source = source(referer);
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String format = dateFormat.format(new Date());
-        homeService.insertRecord(ip,referer,source,format);
+        homeService.insertRecord(ip,subReferer,source,format);
         log.info("首页访问来源记录完成========》"+source);
 		// 获取banner图
 		List<ImageLink> bannerList = homeService.getHomeBanners();
@@ -113,7 +114,7 @@ public class HomeController extends BaseController {
 
 
     private String source(String link) {
-        if (link.contains("www.baidu.com")) {
+        if (link.contains("baidu.com")) {
             return "1";
         }
         if (link.contains("www.so.com")) {