mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
https://github.com/chatopera/cosin/issues/329 enable baidu tongji
This commit is contained in:
parent
9292e8ef95
commit
c0a0f54dc1
@ -54,6 +54,10 @@ public class ApplicationController extends Handler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
|
@Value("${tongji.baidu.sitekey}")
|
||||||
|
private String tongjiBaiduSiteKey;
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/")
|
@RequestMapping("/")
|
||||||
public ModelAndView admin(HttpServletRequest request) {
|
public ModelAndView admin(HttpServletRequest request) {
|
||||||
// logger.info("[admin] path {} queryString {}", request.getPathInfo(),request.getQueryString());
|
// logger.info("[admin] path {} queryString {}", request.getPathInfo(),request.getQueryString());
|
||||||
@ -85,6 +89,12 @@ public class ApplicationController extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
view.addObject("agentStatus", cache.findOneAgentStatusByAgentnoAndOrig(logined.getId(), logined.getOrgi()));
|
view.addObject("agentStatus", cache.findOneAgentStatusByAgentnoAndOrig(logined.getId(), logined.getOrgi()));
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(tongjiBaiduSiteKey) && !StringUtils.equalsIgnoreCase(tongjiBaiduSiteKey, "placeholder")) {
|
||||||
|
logger.info("tongjiBaiduSiteKey: {}", tongjiBaiduSiteKey);
|
||||||
|
view.addObject("tongjiBaiduSiteKey", tongjiBaiduSiteKey);
|
||||||
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ import org.jasypt.exceptions.EncryptionOperationNotPossibleException;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -90,6 +91,9 @@ public class LoginController extends Handler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ACDWorkMonitor acdWorkMonitor;
|
private ACDWorkMonitor acdWorkMonitor;
|
||||||
|
|
||||||
|
@Value("${tongji.baidu.sitekey}")
|
||||||
|
private String tongjiBaiduSiteKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录页面
|
* 登录页面
|
||||||
*
|
*
|
||||||
@ -149,6 +153,12 @@ public class LoginController extends Handler {
|
|||||||
if (systemConfig != null) {
|
if (systemConfig != null) {
|
||||||
view.addObject("systemConfig", systemConfig);
|
view.addObject("systemConfig", systemConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(tongjiBaiduSiteKey) && !StringUtils.equalsIgnoreCase(tongjiBaiduSiteKey, "placeholder")) {
|
||||||
|
logger.info("tongjiBaiduSiteKey: {}", tongjiBaiduSiteKey);
|
||||||
|
view.addObject("tongjiBaiduSiteKey", tongjiBaiduSiteKey);
|
||||||
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,3 +229,13 @@ endpoints.configprops.enabled=false
|
|||||||
endpoints.mappings.enabled=false
|
endpoints.mappings.enabled=false
|
||||||
endpoints.shutdown.enabled=false
|
endpoints.shutdown.enabled=false
|
||||||
endpoints.trace.enabled=false
|
endpoints.trace.enabled=false
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# 百度统计 Key
|
||||||
|
# https://tongji.baidu.com/
|
||||||
|
# 汇总使用情况:登录,打开页面,etc.
|
||||||
|
# 登录 -> 管理 -> 新增网站 -> 代码获取 -> 拷贝SiteKey
|
||||||
|
# hm.src = "https://hm.baidu.com/hm.js?YOUR_SITE_KEY";
|
||||||
|
# 加入后在百度统计内点击:代码安装检查,代码检查成功表示安装成功;注意网站域名等一致,数据收集有延迟。
|
||||||
|
##############################################
|
||||||
|
tongji.baidu.sitekey=
|
@ -143,6 +143,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#if tongjiBaiduSiteKey??>
|
||||||
|
var _hmt = _hmt || [];
|
||||||
|
(function() {
|
||||||
|
var hm = document.createElement("script");
|
||||||
|
hm.src = "https://hm.baidu.com/hm.js?${tongjiBaiduSiteKey}";
|
||||||
|
var s = document.getElementsByTagName("script")[0];
|
||||||
|
s.parentNode.insertBefore(hm, s);
|
||||||
|
})();
|
||||||
|
</#if>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||||
@ -14,6 +12,7 @@
|
|||||||
<link rel="stylesheet" href="/css/login.css">
|
<link rel="stylesheet" href="/css/login.css">
|
||||||
<link rel="stylesheet" href="/css/flexboxgrid.min.css">
|
<link rel="stylesheet" href="/css/flexboxgrid.min.css">
|
||||||
<script src="/layui.js"></script>
|
<script src="/layui.js"></script>
|
||||||
|
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
if((window.frameElement && window.frameElement.id || '') != ""){
|
if((window.frameElement && window.frameElement.id || '') != ""){
|
||||||
top.location.href = "/login.html" ;
|
top.location.href = "/login.html" ;
|
||||||
@ -42,13 +41,21 @@
|
|||||||
document.getElementById("username").value = uid;
|
document.getElementById("username").value = uid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#if tongjiBaiduSiteKey??>
|
||||||
|
var _hmt = _hmt || [];
|
||||||
|
(function() {
|
||||||
|
var hm = document.createElement("script");
|
||||||
|
hm.src = "https://hm.baidu.com/hm.js?${tongjiBaiduSiteKey}";
|
||||||
|
var s = document.getElementsByTagName("script")[0];
|
||||||
|
s.parentNode.insertBefore(hm, s);
|
||||||
|
})();
|
||||||
|
</#if>
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="login">
|
<body class="login">
|
||||||
<div class="login-box">
|
<div class="login-box">
|
||||||
|
|
||||||
|
|
||||||
<div class="login-logo">
|
<div class="login-logo">
|
||||||
<a> <img src="<#if systemConfig?? && systemConfig.loginlogo?? && systemConfig.loginlogo != ''>/res/image.html?id=${systemConfig.loginlogo?url}<#else>images/logo2.png</#if>" style="height:60px;width:220px;">
|
<a> <img src="<#if systemConfig?? && systemConfig.loginlogo?? && systemConfig.loginlogo != ''>/res/image.html?id=${systemConfig.loginlogo?url}<#else>images/logo2.png</#if>" style="height:60px;width:220px;">
|
||||||
</a>
|
</a>
|
||||||
|
@ -51,6 +51,7 @@ services:
|
|||||||
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
||||||
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.3}
|
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.3}
|
||||||
- CSKEFU_SETTINGS_WEBIM_VISITOR_SEPARATE=false
|
- CSKEFU_SETTINGS_WEBIM_VISITOR_SEPARATE=false
|
||||||
|
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
- redis
|
- redis
|
||||||
|
@ -13,3 +13,4 @@ DB_PASSWD=123456
|
|||||||
LOG_LEVEL=INFO
|
LOG_LEVEL=INFO
|
||||||
BOT_THRESHOLD_FAQ_BEST_REPLY=0.8
|
BOT_THRESHOLD_FAQ_BEST_REPLY=0.8
|
||||||
BOT_THRESHOLD_FAQ_SUGG_REPLY=0.6
|
BOT_THRESHOLD_FAQ_SUGG_REPLY=0.6
|
||||||
|
TONGJI_BAIDU_SITEKEY=placeholder
|
Loading…
x
Reference in New Issue
Block a user