Browse Source

Merge branch 'develop' of zhengxifeng/tyqngp into master

zhengxifeng 2 months ago
parent
commit
a46f294a7c

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

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

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

94
                 alert_back('链接类型不允许推送!');
94
                 alert_back('链接类型不允许推送!');
95
             }
95
             }
96
             if ($data->filename) {
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
             } else {
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
             $result = post_baidu($api, $urls);
106
             $result = post_baidu($api, $urls);
102
             if (isset($result->error)) {
107
             if (isset($result->error)) {
103
                 $this->log('百度普通收录推送失败:' . $urls[0]);
108
                 $this->log('百度普通收录推送失败:' . $urls[0]);

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

104
 			                        	{/php}
104
 			                        	{/php}
105
 	
105
 	
106
 			                        	<input type="hidden" name="urls[[value->id]]" value="{php}echo $link{/php}">
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
 		                        	{/if}
110
 		                        	{/if}
109
 		                            {fun=get_btn_del($value->id)}
111
 		                            {fun=get_btn_del($value->id)}
110
 		                            {if(check_level('mod'))}
112
 		                            {if(check_level('mod'))}

Loading…
Cancel
Save