Your Name 2 months ago
parent
commit
c6384f26c8

+ 4
- 0
apps/admin/controller/content/ContentController.php View File

@@ -372,6 +372,10 @@ class ContentController extends Controller
372 372
                     $api = "http://data.zz.baidu.com/urls?site=$domain&token=$token&type=daily";
373 373
                     foreach ($list as $key => $value) {
374 374
                         $url = $domain . $urls[$value];
375
+
376
+                        //替换 .html 后缀
377
+                        $url = str_replace(".html","",$url);
378
+
375 379
                         $this->log('百度快速收录推送:' . $url);
376 380
                         $post_urls[] = $url;
377 381
                     }

+ 7
- 2
apps/admin/controller/content/SingleController.php View File

@@ -94,10 +94,15 @@ class SingleController extends Controller
94 94
                 alert_back('链接类型不允许推送!');
95 95
             }
96 96
             if ($data->filename) {
97
-                $urls[] = $domain . homeurl('/home/Index/' . $data->filename, $url_rule_sort_suffix);
97
+                $url = $domain . homeurl('/home/Index/' . $data->filename, $url_rule_sort_suffix);
98
+                $url = str_replace(".html","",$url);
99
+                $urls[] = $url;
98 100
             } else {
99
-                $urls[] = $domain . homeurl('/home/Index/' . $data->urlname . $url_break_char . $data->scode, $url_rule_sort_suffix);
101
+                $url = $domain . homeurl('/home/Index/' . $data->urlname . $url_break_char . $data->scode, $url_rule_sort_suffix);
102
+                $url = str_replace(".html","",$url);
103
+                $urls[] = $url;
100 104
             }
105
+
101 106
             $result = post_baidu($api, $urls);
102 107
             if (isset($result->error)) {
103 108
                 $this->log('百度普通收录推送失败:' . $urls[0]);

+ 3
- 1
apps/admin/view/default/content/content.html View File

@@ -104,7 +104,9 @@
104 104
 			                        	{/php}
105 105
 	
106 106
 			                        	<input type="hidden" name="urls[[value->id]]" value="{php}echo $link{/php}">
107
-			                        	<a href="{php}echo $link{/php}" class="layui-btn layui-btn-xs layui-btn-primary"  target="_blank">查看</a>
107
+			                        	<a href='{php}
108
+			                        	$link = str_replace(".html","",$link);
109
+			                        	echo $link;{/php}' class="layui-btn layui-btn-xs layui-btn-primary"  target="_blank">查看</a>
108 110
 		                        	{/if}
109 111
 		                            {fun=get_btn_del($value->id)}
110 112
 		                            {if(check_level('mod'))}

Loading…
Cancel
Save