提交 c0a0f54d 编写于 作者: Chatopera 研发团队's avatar Chatopera 研发团队
上级 9292e8ef
......@@ -54,6 +54,10 @@ public class ApplicationController extends Handler {
@Autowired
private Cache cache;
@Value("${tongji.baidu.sitekey}")
private String tongjiBaiduSiteKey;
@RequestMapping("/")
public ModelAndView admin(HttpServletRequest request) {
// 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()));
if (StringUtils.isNotBlank(tongjiBaiduSiteKey) && !StringUtils.equalsIgnoreCase(tongjiBaiduSiteKey, "placeholder")) {
logger.info("tongjiBaiduSiteKey: {}", tongjiBaiduSiteKey);
view.addObject("tongjiBaiduSiteKey", tongjiBaiduSiteKey);
}
return view;
}
......
......@@ -39,6 +39,7 @@ import org.jasypt.exceptions.EncryptionOperationNotPossibleException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -90,6 +91,9 @@ public class LoginController extends Handler {
@Autowired
private ACDWorkMonitor acdWorkMonitor;
@Value("${tongji.baidu.sitekey}")
private String tongjiBaiduSiteKey;
/**
* 登录页面
*
......@@ -149,6 +153,12 @@ public class LoginController extends Handler {
if (systemConfig != null) {
view.addObject("systemConfig", systemConfig);
}
if (StringUtils.isNotBlank(tongjiBaiduSiteKey) && !StringUtils.equalsIgnoreCase(tongjiBaiduSiteKey, "placeholder")) {
logger.info("tongjiBaiduSiteKey: {}", tongjiBaiduSiteKey);
view.addObject("tongjiBaiduSiteKey", tongjiBaiduSiteKey);
}
return view;
}
......@@ -211,14 +221,14 @@ public class LoginController extends Handler {
// 工作状态记录
acdWorkMonitor.recordAgentStatus(agentStatus.getAgentno(),
agentStatus.getUsername(),
agentStatus.getAgentno(),
user.isAdmin(), // 0代表admin
agentStatus.getAgentno(),
MainContext.AgentStatusEnum.OFFLINE.toString(),
MainContext.AgentStatusEnum.READY.toString(),
MainContext.AgentWorkType.MEIDIACHAT.toString(),
orgi, null);
agentStatus.getUsername(),
agentStatus.getAgentno(),
user.isAdmin(), // 0代表admin
agentStatus.getAgentno(),
MainContext.AgentStatusEnum.OFFLINE.toString(),
MainContext.AgentStatusEnum.READY.toString(),
MainContext.AgentWorkType.MEIDIACHAT.toString(),
orgi, null);
} catch (Exception e) {
logger.error("[login] set agent status", e);
......
......@@ -228,4 +228,14 @@ endpoints.loggers.enabled=false
endpoints.configprops.enabled=false
endpoints.mappings.enabled=false
endpoints.shutdown.enabled=false
endpoints.trace.enabled=false
\ No newline at end of file
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=
\ No newline at end of file
......@@ -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>
</head>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
......@@ -14,6 +12,7 @@
<link rel="stylesheet" href="/css/login.css">
<link rel="stylesheet" href="/css/flexboxgrid.min.css">
<script src="/layui.js"></script>
<script language="javascript">
if((window.frameElement && window.frameElement.id || '') != ""){
top.location.href = "/login.html" ;
......@@ -42,13 +41,21 @@
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>
</head>
<body class="login">
<div class="login-box">
<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>
......
......@@ -51,6 +51,7 @@ services:
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.3}
- CSKEFU_SETTINGS_WEBIM_VISITOR_SEPARATE=false
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
depends_on:
- mysql
- redis
......
......@@ -12,4 +12,5 @@ ACTIVEMQ_PORT3=8053
DB_PASSWD=123456
LOG_LEVEL=INFO
BOT_THRESHOLD_FAQ_BEST_REPLY=0.8
BOT_THRESHOLD_FAQ_SUGG_REPLY=0.6
\ No newline at end of file
BOT_THRESHOLD_FAQ_SUGG_REPLY=0.6
TONGJI_BAIDU_SITEKEY=placeholder
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册