dever 3 éve
szülő
commit
0e65f83b41
2 módosított fájl, 12 hozzáadás és 10 törlés
  1. 11 0
      main/src/Api.php
  2. 1 10
      main/template/pc/inc/head.php

+ 11 - 0
main/src/Api.php

@@ -57,6 +57,17 @@ class Api
         }
         $data['citys'] = implode('', $data['citys']);
 
+        $data['baidu'] = '<script>
+var _hmt = _hmt || [];
+(function() {
+  var hm = document.createElement("script");
+  hm.src = "https://hm.baidu.com/hm.js?4f5a8be51cf141219d4f6eb2c1efef73";
+  var s = document.getElementsByTagName("script")[0]; 
+  s.parentNode.insertBefore(hm, s);
+})();
+</script>
+';
+
         return $data;
     }
 

+ 1 - 10
main/template/pc/inc/head.php

@@ -46,13 +46,4 @@ $view
 ))
 
 ->append('head',    '<script><{Dever::script()}></script>')
-->append('html',    '<script>
-var _hmt = _hmt || [];
-(function() {
-  var hm = document.createElement("script");
-  hm.src = "https://hm.baidu.com/hm.js?4f5a8be51cf141219d4f6eb2c1efef73";
-  var s = document.getElementsByTagName("script")[0]; 
-  s.parentNode.insertBefore(hm, s);
-})();
-</script>
-');
+->append('html',    'main/api.config#baidu');