fix:修复hexo无法显示问题

This commit is contained in:
fanxb 2022-03-01 15:29:01 +08:00
parent e6f62daf49
commit 500804fc1a
3 changed files with 33 additions and 37 deletions

View File

@ -44,6 +44,7 @@ public class ApplicationController {
* date 2022/2/16 15:24 * date 2022/2/16 15:24
*/ */
@GetMapping("/visit") @GetMapping("/visit")
@ResponseBody
public void visit(HttpServletRequest request, HttpServletResponse response, public void visit(HttpServletRequest request, HttpServletResponse response,
@NotBlank(message = "回调函数不能为空") String callBack, @NotBlank(message = "key不能为空") String key) throws IOException { @NotBlank(message = "回调函数不能为空") String callBack, @NotBlank(message = "key不能为空") String key) throws IOException {
applicationService.visit(request, response, callBack, key); applicationService.visit(request, response, callBack, key);

View File

@ -21,8 +21,6 @@
postNode.style.display = "inline"; postNode.style.display = "inline";
} }
}; };
setTimeout(
function () {
var script = document.createElement("script"); var script = document.createElement("script");
script.type = "text/javascript"; script.type = "text/javascript";
script.defer = true; script.defer = true;
@ -52,9 +50,6 @@
"/qiezi/api/application/visit?callBack=" + "/qiezi/api/application/visit?callBack=" +
callback + callback +
"&key=" + "&key=" +
window.qieziStatisticKey; key;
document.getElementsByTagName("head")[0].appendChild(script); document.getElementsByTagName("head")[0].appendChild(script);
},
window.qieziStatisticKey == undefined ? 1000 : 1,
);
})(); })();

View File

@ -1 +1 @@
(function(){var name="qieziStatisticHtml";var callback=name+"CallBack";window[callback]=function(a){var hostPvNode=document.getElementById(name+"HostPv");if(hostPvNode!=null){document.getElementById(name+"HostPvValue").innerText=a.totalPv;hostPvNode.style.display="inline"}var hostUvNode=document.getElementById(name+"HostUv");if(hostUvNode!=null){document.getElementById(name+"HostUvValue").innerText=a.totalUv;hostUvNode.style.display="inline"}var postNode=document.getElementById(name+"Post");if(postNode!=null){document.getElementById(name+"PostPv").innerText=a.pagePv;postNode.style.display="inline"}};setTimeout(function(){var script=document.createElement("script");script.type="text/javascript";script.defer=true;var requestHost="https://qiezi.fleyx.com";if(window.qieziStatisticHost!=undefined&&window.qieziStatisticHost.trim().length>0){requestHost=window.qieziStatisticHost}else if(window.CONFIG&&window.CONFIG.web_analytics.qieziStatistics.app_host){var temp=window.CONFIG.web_analytics.qieziStatistics.app_host;if(temp.trim().length>0){requestHost=temp}}var key=null;if(window.qieziStatisticKey&&window.qieziStatisticKey.trim().length>0){key=window.qieziStatisticKey}else if(window.CONFIG&&window.CONFIG.web_analytics.qieziStatistics.app_key){var temp=window.CONFIG.web_analytics.qieziStatistics.app_key;if(temp.trim().length>0){key=temp}}console.log(requestHost,key);if(!key){return}script.src=requestHost+"/qiezi/api/application/visit?callBack="+callback+"&key="+window.qieziStatisticKey;document.getElementsByTagName("head")[0].appendChild(script)},window.qieziStatisticKey==undefined?1000:1,)})(); (function(){var name="qieziStatisticHtml";var callback=name+"CallBack";window[callback]=function(a){var hostPvNode=document.getElementById(name+"HostPv");if(hostPvNode!=null){document.getElementById(name+"HostPvValue").innerText=a.totalPv;hostPvNode.style.display="inline"}var hostUvNode=document.getElementById(name+"HostUv");if(hostUvNode!=null){document.getElementById(name+"HostUvValue").innerText=a.totalUv;hostUvNode.style.display="inline"}var postNode=document.getElementById(name+"Post");if(postNode!=null){document.getElementById(name+"PostPv").innerText=a.pagePv;postNode.style.display="inline"}};var script=document.createElement("script");script.type="text/javascript";script.defer=true;var requestHost="https://qiezi.fleyx.com";if(window.qieziStatisticHost!=undefined&&window.qieziStatisticHost.trim().length>0){requestHost=window.qieziStatisticHost}else if(window.CONFIG&&window.CONFIG.web_analytics.qieziStatistics.app_host){var temp=window.CONFIG.web_analytics.qieziStatistics.app_host;if(temp.trim().length>0){requestHost=temp}}var key=null;if(window.qieziStatisticKey&&window.qieziStatisticKey.trim().length>0){key=window.qieziStatisticKey}else if(window.CONFIG&&window.CONFIG.web_analytics.qieziStatistics.app_key){var temp=window.CONFIG.web_analytics.qieziStatistics.app_key;if(temp.trim().length>0){key=temp}}console.log(requestHost,key);if(!key){return}script.src=requestHost+"/qiezi/api/application/visit?callBack="+callback+"&key="+key;document.getElementsByTagName("head")[0].appendChild(script)})();