Commit 40d63bb9 by Huang Linyu

来电弹屏功能优化

parent 7f8bf0a4
...@@ -115,7 +115,7 @@ public class SipPhoneControl { ...@@ -115,7 +115,7 @@ public class SipPhoneControl {
// String agentAid = request.getAttribute("userName").toString(); // String agentAid = request.getAttribute("userName").toString();
String agentAid = SpringSecurityUtil.getCurrentUserName(); String agentAid = SpringSecurityUtil.getCurrentUserName();
String sipPhoneName = request.getParameter("sipPhoneName"); String sipPhoneName = request.getParameter("sipPhoneName");
System.out.println("bbbbbbbbbbbbbbbbbbbbb:"+agentAid+" "+ sipPhoneName+" "); // System.out.println("bbbbbbbbbbbbbbbbbbbbb:"+agentAid+" "+ sipPhoneName+" ");
return sipPhoneService.bind(agentAid, sipPhoneName); return sipPhoneService.bind(agentAid, sipPhoneName);
} }
......
...@@ -20,6 +20,7 @@ import org.springframework.ui.ModelMap; ...@@ -20,6 +20,7 @@ import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError; import org.springframework.validation.FieldError;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
...@@ -104,6 +105,12 @@ public class CallCenterController { ...@@ -104,6 +105,12 @@ public class CallCenterController {
} }
} }
@RequestMapping(value = "/tools/validCode/{mobileNo}", method = RequestMethod.GET)
public String validFail(HttpServletRequest request, @PathVariable String mobileNo, ModelMap model) {
model.put("mobileNo", mobileNo);
return "/tools/validCode";
}
/** /**
* *
* @return * @return
......
...@@ -82,7 +82,7 @@ public class NewStateWebSocket { ...@@ -82,7 +82,7 @@ public class NewStateWebSocket {
} }
if("".equals(uid)){ if("".equals(uid)){
System.out.println("Callcenter pop window:手机号码"+mobileNo+"没有注册!"); System.out.println("Callcenter pop window:手机号码"+mobileNo+"没有注册!");
message = "/tools/validCode "+mobileNo; message = "/cc/tools/validCode/"+mobileNo;
} }
try { try {
session.getBasicRemote().sendText(message); session.getBasicRemote().sendText(message);
......
...@@ -94,16 +94,6 @@ ...@@ -94,16 +94,6 @@
$("#btnSendCode").val("请在" + curCount + "秒后再获取验证码"); $("#btnSendCode").val("请在" + curCount + "秒后再获取验证码");
} }
} }
document.onreadystatechange = function(e){
if (document.readyState === 'complete')
window.addEventListener('message', function(e){
var params = e.data;
$("#oriMobileNo").val(params[0][1]);
$("#mobileNo").val(params[0][1]);
});
}
}
</script> </script>
...@@ -111,10 +101,10 @@ ...@@ -111,10 +101,10 @@
<@com.layout title="电话注册 " module="system" pageJs=pageJsContent> <@com.layout title="电话注册 " module="system" pageJs=pageJsContent>
该电话用户未注册,请先注册 该电话用户未注册,请先注册
<form action="/cc/userRegister" method="post"> <form action="/cc/userRegister" method="post">
<input type="hidden" id="oriMobileNo" name="oriMobileNo" /> <input type="hidden" id="oriMobileNo" name="oriMobileNo" value="${mobileNo!}" />
<div> <div>
手机号码: 手机号码:
<input type="text" name="mobileNo" id="mobileNo" title="请输入手机号" placeholder="请输入正确手机号" /> <input type="text" name="mobileNo" id="mobileNo" title="请输入手机号" placeholder="请输入正确手机号" value="${mobileNo!}" />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<input type="button" id="btnSendCode" class="btn btn-primary" value="获取验证码" <input type="button" id="btnSendCode" class="btn btn-primary" value="获取验证码"
onclick="sendValidCode()" /> onclick="sendValidCode()" />
......
...@@ -9,15 +9,17 @@ ...@@ -9,15 +9,17 @@
webSocket.onerror = function(event) {}; webSocket.onerror = function(event) {};
webSocket.onopen = function(event) {}; webSocket.onopen = function(event) {};
webSocket.onmessage = function(event) { webSocket.onmessage = function(event) {
if(event.data.startsWith("/tools/validCode")){ if(event.data.startsWith("/cc/tools/validCode")){
var message = event.data; /*var message = event.data;
var msgArr = message.split(" "); var msgArr = message.split(" ");
var popupwin = window.open(event.data, "用户来电通知"); var popupwin = window.open(msgArr[0], "用户来电通知");
var params = new Array(); var params = new Array();
params[0] = new Array("mobileNo",msgArr[1]); params[0] = new Array("mobileNo",msgArr[1]);
popupwin.onload = function(e){ popupwin.onload = function(e){
popupwin.postMessage(params,"http://"+window.location.host); popupwin.postMessage(params,"http://"+window.location.host);
} }*/
window.open(event.data);
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment