mirror of
https://github.com/chatopera/cosin.git
synced 2025-06-29 07:11:38 +08:00
https://github.com/chatopera/cosin/issues/253 fix https protocal detection issue
This commit is contained in:
parent
ac7a346bf6
commit
a5e475fe35
@ -161,6 +161,13 @@ public class EntIMController extends Handler {
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/expand")
|
||||||
|
@Menu(type = "im", subtype = "entim", access = false)
|
||||||
|
public ModelAndView expand(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
ModelAndView view = request(super.createEntIMTempletResponse("/apps/entim/expand"));
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping("/chat")
|
@RequestMapping("/chat")
|
||||||
@Menu(type = "im", subtype = "entim", access = false)
|
@Menu(type = "im", subtype = "entim", access = false)
|
||||||
public ModelAndView chat(HttpServletRequest request, HttpServletResponse response, @Valid String userid) {
|
public ModelAndView chat(HttpServletRequest request, HttpServletResponse response, @Valid String userid) {
|
||||||
|
@ -49,7 +49,7 @@ public class BlackEntity implements java.io.Serializable{
|
|||||||
private String agentserviceid ; //agent service id
|
private String agentserviceid ; //agent service id
|
||||||
private String description ; //备注黑名单原因
|
private String description ; //备注黑名单原因
|
||||||
private int times ; //对话次数
|
private int times ; //对话次数
|
||||||
private int chattime ; //最后一次对话时长
|
private int chattime ; //最后一次对话时长
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(length = 32)
|
@Column(length = 32)
|
||||||
|
@ -53,5 +53,4 @@ public interface AgentServiceRepository
|
|||||||
|
|
||||||
Page<AgentService> findAll(Specification<AgentService> spec, Pageable pageable); //分页按条件查询
|
Page<AgentService> findAll(Specification<AgentService> spec, Pageable pageable); //分页按条件查询
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,15 +17,18 @@
|
|||||||
package com.chatopera.cc.proxy;
|
package com.chatopera.cc.proxy;
|
||||||
|
|
||||||
import com.chatopera.cc.cache.Cache;
|
import com.chatopera.cc.cache.Cache;
|
||||||
|
import com.chatopera.cc.model.AgentService;
|
||||||
import com.chatopera.cc.model.AgentUser;
|
import com.chatopera.cc.model.AgentUser;
|
||||||
import com.chatopera.cc.model.BlackEntity;
|
import com.chatopera.cc.model.BlackEntity;
|
||||||
import com.chatopera.cc.model.User;
|
import com.chatopera.cc.model.User;
|
||||||
|
import com.chatopera.cc.persistence.repository.AgentServiceRepository;
|
||||||
import com.chatopera.cc.persistence.repository.AgentUserRepository;
|
import com.chatopera.cc.persistence.repository.AgentUserRepository;
|
||||||
import com.chatopera.cc.persistence.repository.BlackListRepository;
|
import com.chatopera.cc.persistence.repository.BlackListRepository;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -40,6 +43,10 @@ public class BlackEntityProxy {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AgentUserRepository agentUserRepository;
|
private AgentUserRepository agentUserRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AgentServiceRepository agentServiceRes;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新或创建黑名单记录
|
* 更新或创建黑名单记录
|
||||||
*
|
*
|
||||||
@ -89,7 +96,11 @@ public class BlackEntityProxy {
|
|||||||
blackEntityUpdated.setAgentuser(agentUser.getUsername());
|
blackEntityUpdated.setAgentuser(agentUser.getUsername());
|
||||||
}
|
}
|
||||||
|
|
||||||
blackEntityUpdated.setAgentserviceid(agentserviceid);
|
AgentService agentService = agentServiceRes.findByIdAndOrgi(agentserviceid, orgi);
|
||||||
|
if (agentService != null) {
|
||||||
|
blackEntityUpdated.setChattime((int) agentService.getSessiontimes());
|
||||||
|
}
|
||||||
|
|
||||||
blackListRes.save(blackEntityUpdated);
|
blackListRes.save(blackEntityUpdated);
|
||||||
|
|
||||||
return blackEntityUpdated;
|
return blackEntityUpdated;
|
||||||
|
@ -200,6 +200,7 @@ public class IMEventHandler {
|
|||||||
p.setName(contacts.getName());
|
p.setName(contacts.getName());
|
||||||
p.setPhone(contacts.getPhone());
|
p.setPhone(contacts.getPhone());
|
||||||
p.setEmail(contacts.getEmail());
|
p.setEmail(contacts.getEmail());
|
||||||
|
p.setResion(contacts.getMemo());
|
||||||
p.setChatbotops(false); // 非机器人客服
|
p.setChatbotops(false); // 非机器人客服
|
||||||
p.setOpttype(MainContext.OptType.HUMAN.toString());
|
p.setOpttype(MainContext.OptType.HUMAN.toString());
|
||||||
getAgentUserProxy().save(p);
|
getAgentUserProxy().save(p);
|
||||||
@ -210,6 +211,7 @@ public class IMEventHandler {
|
|||||||
p.setName(contacts.getName());
|
p.setName(contacts.getName());
|
||||||
p.setPhone(contacts.getPhone());
|
p.setPhone(contacts.getPhone());
|
||||||
p.setEmail(contacts.getEmail());
|
p.setEmail(contacts.getEmail());
|
||||||
|
p.setResion(contacts.getMemo());
|
||||||
agentServiceRepository.save(p);
|
agentServiceRepository.save(p);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
<div class="ukefu-entim-point ukefu-entim-msgbox" style="cursor: pointer;" onclick="top.closeentim();" title="展开">
|
||||||
|
<div class=" expand" style="width: 100%;height: 100%;">
|
||||||
|
<i class="layui-icon" ></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<style>
|
||||||
|
.expand:hover{
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
</style>
|
@ -6,9 +6,17 @@
|
|||||||
<#assign newmsg = recentUser.newmsg + newmsg>
|
<#assign newmsg = recentUser.newmsg + newmsg>
|
||||||
</#list>
|
</#list>
|
||||||
</#if>
|
</#if>
|
||||||
<span class="layui-anim layer-anim-05 animated" id="msgbox" data-newmsg="${newmsg}" style="<#if newmsg == 0>display:none;</#if>top: 15px;background-color: red;left: 30px;">${newmsg}</span>
|
<span class="layui-anim layer-anim-05 animated" id="msgbox" data-newmsg="${newmsg}" style="<#if newmsg == 0>display:none;</#if>top: 15px;background-color: red;left: 0px;">${newmsg}</span>
|
||||||
春松客服-企业聊天
|
企业聊天
|
||||||
|
<div class="putAway" id="putAway" title="收起" style="width:30px; height: 100%;float: right">
|
||||||
|
<i class="layui-icon"></i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<style>
|
||||||
|
.putAway:hover{
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script>
|
<script>
|
||||||
var hostname = location.hostname ;
|
var hostname = location.hostname ;
|
||||||
var socket = io.connect(location.protocol+"//"+top.hostname+":"+top.port+"/im/ent?userid=${user.id!''!''}&orgi=${user.orgi!''}");
|
var socket = io.connect(location.protocol+"//"+top.hostname+":"+top.port+"/im/ent?userid=${user.id!''!''}&orgi=${user.orgi!''}");
|
||||||
@ -20,4 +28,10 @@
|
|||||||
|
|
||||||
socket.on('disconnect',function() {
|
socket.on('disconnect',function() {
|
||||||
});
|
});
|
||||||
|
$("#putAway").click(function(e){
|
||||||
|
top.isImIndex = true;
|
||||||
|
top.closeentim();
|
||||||
|
e.stopPropagation();
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -57,9 +57,8 @@ arr.push(('randomNumber=' + Math.random()).replace('.'));
|
|||||||
return arr.join('&');
|
return arr.join('&');
|
||||||
}
|
}
|
||||||
|
|
||||||
var protocol = window.location.protocol.replace(/:/g,'');
|
var protocol = "${schema!''}"
|
||||||
<!--var protocol = "${schema!''}"-->
|
|
||||||
<!--console.log('protocol',protocol)-->
|
|
||||||
document.cookie=""
|
document.cookie=""
|
||||||
|
|
||||||
function chatoperaInit(info) {
|
function chatoperaInit(info) {
|
||||||
@ -164,8 +163,6 @@ function closerefresh(){
|
|||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
var protocol = window.location.protocol.replace(/:/g,'');
|
|
||||||
<!--var protocol = "$!''}"-->
|
|
||||||
var cskefu = {
|
var cskefu = {
|
||||||
service: {agentno: null},
|
service: {agentno: null},
|
||||||
time : new Date().getTime(),
|
time : new Date().getTime(),
|
||||||
|
@ -65,6 +65,8 @@
|
|||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
var hostname = "${hostname!''}" , adminuser = "<#if user.admin?? && user.admin>true<#else>false</#if>" , schema = "${schema!'http'}", port = "${webimport!''}" , userid = "${user.id!''}" , session = "${sessionid!''}" , orgi = "${orgi!''}";
|
var hostname = "${hostname!''}" , adminuser = "<#if user.admin?? && user.admin>true<#else>false</#if>" , schema = "${schema!'http'}", port = "${webimport!''}" , userid = "${user.id!''}" , session = "${sessionid!''}" , orgi = "${orgi!''}";
|
||||||
var layinx , layerhelper ;
|
var layinx , layerhelper ;
|
||||||
|
var isImIndex = false;
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
layui.use('layer', function(){
|
layui.use('layer', function(){
|
||||||
layerhelper = layer ;
|
layerhelper = layer ;
|
||||||
@ -83,26 +85,45 @@
|
|||||||
title: false,
|
title: false,
|
||||||
closeBtn: 0, //不显示关闭按钮
|
closeBtn: 0, //不显示关闭按钮
|
||||||
shade: [0],
|
shade: [0],
|
||||||
area: ["200px", "50px"],
|
area: ["120px", "50px"],
|
||||||
offset: "rb", //右下角弹出
|
offset: "rb", //右下角弹出
|
||||||
anim: 2,
|
anim: 2,
|
||||||
shade: 0,
|
shade: 0,
|
||||||
content: "/ent/im/point.html",
|
content: "/ent/im/point.html",
|
||||||
end:function(){
|
end:function(){
|
||||||
layinx = layer.open({
|
if(isImIndex == true){
|
||||||
|
layinx = layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
title: false,
|
title: false,
|
||||||
closeBtn: 0, //不显示关闭按钮
|
closeBtn: 0, //不显示关闭按钮
|
||||||
shade: [0],
|
shade: [0],
|
||||||
area: ["260px", "520px"],
|
area: ["30px", "50px"],
|
||||||
offset: "rb", //右下角弹出
|
offset: "rb", //右下角弹出
|
||||||
anim: 2,
|
anim: 2,
|
||||||
shade: 0,
|
shade: 0,
|
||||||
content: ["/ent/im/index.html", "no"], //iframe的url,no代表不显示滚动条
|
content: "/ent/im/expand.html",
|
||||||
end: function(){ //此处用于演示
|
end: function(){ //此处用于演示
|
||||||
imDialogHelper.open();
|
imDialogHelper.open();
|
||||||
}
|
isImIndex = false;
|
||||||
});
|
}
|
||||||
|
})
|
||||||
|
isImIndex = false;
|
||||||
|
}else{
|
||||||
|
layinx = layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: false,
|
||||||
|
closeBtn: 0, //不显示关闭按钮
|
||||||
|
shade: [0],
|
||||||
|
area: ["260px", "520px"],
|
||||||
|
offset: "rb", //右下角弹出
|
||||||
|
anim: 2,
|
||||||
|
shade: 0,
|
||||||
|
content: ["/ent/im/index.html", "no"], //iframe的url,no代表不显示滚动条
|
||||||
|
end: function(){ //此处用于演示
|
||||||
|
imDialogHelper.open();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -121,6 +142,7 @@
|
|||||||
layerhelper.close(layinx);
|
layerhelper.close(layinx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@ -169,7 +191,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<li class="layui-nav-item"><a href="javascript:void(0)">
|
<li class="layui-nav-item"><a href="javascript:void(0)">
|
||||||
<i class="layui-icon" style="position: relative;float:left;"></i>
|
<i class="layui-icon" style="position: relative;float:left;"></i>
|
||||||
<span style="display: inline-block;max-width: 90px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float: left">
|
<span style="display: inline-block;max-width: 90px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float: left">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user