Prechádzať zdrojové kódy

Merge branch 'dev' of http://git.bocai108.com:10180/Ethan/Customer-Service into dev

Jonlin 6 rokov pred
rodič
commit
9a34c84d60

+ 7 - 7
application/admin/controller/Settings.php

@@ -13,11 +13,11 @@ class Settings extends Base
     {
         if(request()->isAjax()){
             // 查询目录下所有文件
-            $files = $this->allFile(ROOT_PATH.'entranceJs/new');
+            $files = $this->allFile(ROOT_PATH.'public/entranceJs/new');
             $filesInfo = [];
             foreach ($files as $v) {
-                $addTime = filemtime(ROOT_PATH."entranceJs/new/$v");
-                $lastLoad = fileatime(ROOT_PATH."entranceJs/new/$v");
+                $addTime = filemtime(ROOT_PATH."public/entranceJs/new/$v");
+                $lastLoad = fileatime(ROOT_PATH."public/entranceJs/new/$v");
                 $filesInfo[] = (object)[
                     'fileName' => $v,
                     'addTime' => date("Y-m-d H:i:s",$addTime),
@@ -41,7 +41,7 @@ class Settings extends Base
             $param = input('post.');
             $name = $param['name'];
             // 查询目录下所有文件
-            $files = $this->allFile(ROOT_PATH.'entranceJs/new');
+            $files = $this->allFile(ROOT_PATH.'public/entranceJs/new');
             $have = 0;
             // 判断是否存在该文件.
             foreach ($files as $v) {
@@ -55,7 +55,7 @@ class Settings extends Base
                 return json(['code' => -2, 'data' => '', 'msg' => '文件名已存在']);
             }
             $result = db('guestenter')->order('sort','asc')->select();
-            $copy = $this->file2dir(ROOT_PATH.'entranceJs/FloatingButton.js',ROOT_PATH.'entranceJs/new/', $name.'.js');
+            $copy = $this->file2dir(ROOT_PATH.'public/entranceJs/FloatingButton.js',ROOT_PATH.'public/entranceJs/new/', $name.'.js');
             $result[] = (object)[
                 "margin_top" => $param['marginTop'],
                 "stop_time" => $param['overtime'],
@@ -64,7 +64,7 @@ class Settings extends Base
             $data = json_encode($result);
             if ($copy) {
                 $dataArr = ["data = $data;"];
-                $result = $this->UpdataFile(ROOT_PATH.'entranceJs/new/'.$name.'.js', $dataArr, 24, 24, false);
+                $result = $this->UpdataFile(ROOT_PATH.'public/entranceJs/new/'.$name.'.js', $dataArr, 24, 24, false);
                 if ($result) {
                     return json(['code' => 1, 'data' => 'settings/index', 'msg' => '入口添加成功']);
                 } else {
@@ -230,7 +230,7 @@ class Settings extends Base
             $fileName = input('param.fileName');
 
             try{
-                unlink(ROOT_PATH."entranceJs/new/$fileName");
+                unlink(ROOT_PATH."public/entranceJs/new/$fileName");
             }catch(\Exception $e){
                 return json(['code' => -1, 'data' => '', 'msg' => $e->getMessage()]);
             }

+ 2 - 1
application/admin/view/index/index.html

@@ -347,7 +347,8 @@
   let date = new Date(new Date().setHours(0, 0, 0, 0)) / 1000;
   let getLocation = window.location.href;
   let host = getLocation.split('/admin')[0];
-  let apiToken = hex_md5('customer-service'+date+host);
+  //let apiToken = hex_md5('customer-service'+date+host);
+  let apiToken = hex_md5('customer-service'+host);
   let socket = new WebSocket('ws://' + config.socket+'?apiToken=' + apiToken);
   socket.onopen = function(res) {
     console.log('握手成功');

+ 2 - 2
application/index/controller/Common.php

@@ -23,8 +23,8 @@ class Common extends Controller
         $action      = $request->action();
         $controller  = $request->controller();
         $module      = $request->module();
-        $apiToken    = md5(strtolower($action.'Customer-Service'.$controller.strtotime(date('Y-m-d')).$module));
-        //print_r([strtolower($action.'Customer-Service'.$controller.strtotime(date('Y-m-d')).$module),$apiToken, $getApiToken]);die;
+        $apiToken    = md5(strtolower($action.'Customer-Service'.$controller.$module));
+        //print_r([strtolower($action.'Customer-Service'.$controller.$module),$apiToken, $getApiToken]);die;
         if ($getApiToken === $apiToken) {
             return true;
         } else {

+ 1 - 1
application/service/controller/Common.php

@@ -22,7 +22,7 @@ class Common extends Base
         $action       = $request->action();
         $controller   = $request->controller();
         $module       = $request->module();
-        $apiToken     = md5(strtolower($action.'Customer-Service'.$controller.strtotime(date('Y-m-d')).$module));
+        $apiToken     = md5(strtolower($action.'Customer-Service'.$controller.$module));
         //print_r([$apiToken,$getApiToken]);die;
         // 验证服务器token.
         if ($getApiToken === $apiToken && empty($getUserToken) === false) {

+ 155 - 0
public/entranceJs/FloatingButton.js

@@ -0,0 +1,155 @@
+var xmlhttp=new XMLHttpRequest();
+var data = [];//配置信息
+var appip_source = '';
+var appuip_user = '';
+var isIE=!!window.ActiveXObject;    //是否IE浏览器
+var isIE6=isIE&&!window.XMLHttpRequest;  //是否IE6浏览器
+var isIE7=isIE&&!isIE6&&!isIE8;  //是否IE7浏览器
+var isIE8=isIE&&!!document.documentMode;  //是否IE8浏览器
+var availheight = screen.availHeight;   //默认高度为屏幕的高度
+var hostname = location.protocol+'//'+location.host;
+var adminDomain = 'http://kfadmin.bocai186.com';   //服务器域名
+var serverDomain = 'http://kefu.bocai186.com';   //客服域名
+var userDomain = 'http://kf.bocai186.com?pid='+escape("~!@#¥%……&*()——+,./;\'[]");   //用户域名
+if(isIE8){
+  availheight= screen.height;
+}
+//IE11升级弹出窗口小
+if (!!window.ActiveXObject || "ActiveXObject" in window){
+  availheight= screen.height;
+}
+
+
+var div = document.createElement('div');
+
+data = [];
+//浮动按钮样式
+div.style = `position: fixed; right:15px; top:${data[data.length - 1].margin_top}px;width:80px;background: #867c7c00;border-radius: 10px 0 0 10px;
+            display:flex;flex-direction: column; justify-content: space-between;z-index:1000;`;
+div.style.height = 80 * (data.length) + 'px';
+//拼接浮动按钮样式
+let btn_html = '';
+for (let i = 0; i < data.length - 1; i++) {
+  btn_html += `<div id='set_user_info_${data[i].group_id}' style="width:80px;height:80px;background:#9a949775;display:flex;
+                flex-direction: column;justify-content: center;align-items: center; cursor:pointer;z-index:1000; "> 
+                <img  id='set_user_img_${data[i].group_id}'src='${adminDomain}${data[i].image}'></img> 
+                <span id='set_user_span_${data[i].group_id}' style="font-size:12px;font-weight:bold; color: #f0f0f0;">${data[i].name}</span> </div>`;
+}
+div.innerHTML = btn_html;
+//延时显示提示框
+setTimeout(function () {
+  create_prompt_box();
+}, data[data.length - 1].stop_time * 1000);
+
+/***
+ * 打开会话窗口
+ */
+div.onclick =function(e){
+  console.log(window.location.href)
+  var index=e.target.id.lastIndexOf("_");
+  // console.log(e.target,index);
+  var group_id  = e.target.id.substring(index+1,e.target.id.length);
+  console.log(window);
+  if(appuip_user && appip_source){
+    openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user+'&group_id='+group_id,700,700);
+  }else{
+    openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user,700,700);
+  }
+}
+//将浮动按钮添加到对应到网站body上
+setTimeout(function(){
+  document.body.appendChild(div);
+}, 2000);
+
+
+
+
+/**
+ * 提示框样式
+ */
+function create_prompt_box(){
+  var popupWindowBox = document.createElement('div');
+  popupWindowBox.style = `position: fixed; top:35%; padding: 10px; left:45%;width:350px;height:160px;
+    background:#e5e5e5;border-radius:10px;font-size:17px;display:flex; flex-direction: column;
+    justify-content: space-between;z-index:9999;`;
+  //拼接提示框样式
+  popupWindowBox.innerHTML =`
+    <div style='display:flex;flex-direction: row;justify-content: center;'> 
+    <span style="font-weight:bold; color: #666666;">${data[data.length - 1].copywriting}</span> 
+    </div> 
+    <div style='flex-direction: row;display:flex;justify-content: flex-end;'>
+    <div id="$startSession" style='margin-right: 10px; padding: 4px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;'>开始会话</div>
+    <div id="$cancel" style="padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;">下次再说</div> 
+    </div> 
+    `;
+  popupWindowBox.onclick =function(e){
+    if(e.target.id == '$startSession'){
+      openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user,700,700);
+    }else if(e.target.id == '$cancel'){
+      popupWindowBox.style.display="none";
+    }
+  }
+
+
+  //将提示框添加到对应到网站body上
+  document.body.appendChild(popupWindowBox);
+}
+
+// padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;
+
+// /***
+//  *
+//  */
+// function   (){
+
+// }
+
+/**
+ * 打开一个居中的窗口
+ * @param pageUrl url链接
+ * @param innerWidth 宽度,不带px,小于0表示百分比
+ * @param innerHeight 高度,不带px,小于0表示百分比
+ */
+function openWindowCenter(pageUrl, innerWidth, innerHeight){
+  var screenWidth = screen.availWidth;
+  var screenHeight = screen.availHeight;
+  var width = screenWidth;
+  var height = screenHeight;
+
+  if(innerWidth < 1){
+    width = screenWidth * innerWidth;
+    screenWidth = (screen.availWidth - width)/2;
+  }else{
+    width = innerWidth;
+    screenWidth = (screen.availWidth - innerWidth)/2;
+  }
+  if(innerHeight < 1){
+    height = screenHeight * innerHeight;
+    screenHeight = (screen.availHeight - height)/2;
+  }else{
+    height = innerHeight;
+    screenHeight = (screen.availHeight - innerHeight)/2;
+  }
+  window.open(pageUrl, "", "left=" + screenWidth + ",top=" + screenHeight +",width=" + width + ",height=" + height + ",resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
+};
+
+
+//html页面调用
+/**
+ * 获取数据
+ */
+function set_user_info_js(a,b){
+  appip_source = a;
+  appuip_user=b;
+}
+
+//vue调用
+// export default {
+//     /**
+//      * 获取数据
+//      */
+//     set_user_info_vue: function (a,b){
+//         appip_source = a;
+//         appuip_user =b;
+//     }
+// }

+ 155 - 0
public/entranceJs/new/88.js

@@ -0,0 +1,155 @@
+var xmlhttp=new XMLHttpRequest();
+var data = [];//配置信息
+var appip_source = '';
+var appuip_user = '';
+var isIE=!!window.ActiveXObject;    //是否IE浏览器
+var isIE6=isIE&&!window.XMLHttpRequest;  //是否IE6浏览器
+var isIE7=isIE&&!isIE6&&!isIE8;  //是否IE7浏览器
+var isIE8=isIE&&!!document.documentMode;  //是否IE8浏览器
+var availheight = screen.availHeight;   //默认高度为屏幕的高度
+var hostname = location.protocol+'//'+location.host;
+var adminDomain = 'http://kfadmin.bocai186.com';   //服务器域名
+var serverDomain = 'http://kefu.bocai186.com';   //客服域名
+var userDomain = 'http://kf.bocai186.com?pid='+escape("~!@#¥%……&*()——+,./;\'[]");   //用户域名
+if(isIE8){
+  availheight= screen.height;
+}
+//IE11升级弹出窗口小
+if (!!window.ActiveXObject || "ActiveXObject" in window){
+  availheight= screen.height;
+}
+
+
+var div = document.createElement('div');
+
+data = [{"id":2,"name":"\u552e\u540e\u652f\u6301","image":"\/uploads\/20190809\/8005f8e4bd78904794f5b2eae54957b4.png","group_id":"2","sort":2},{"id":5,"name":"\u552e\u524d\u54a8\u8be2","image":"\/uploads\/20190809\/ce52fd990d35c4c100af6e1fbe708a55.png","group_id":"1","sort":3},{"id":6,"name":"\u5728\u7ebf\u5ba2\u670d","image":"\/uploads\/20190809\/233b8dce85c445b5dd3c092526146d9c.png","group_id":"all","sort":8},{"margin_top":"30","stop_time":"1","copywriting":"\u60a8\u597d\uff0c\u8bf7\u95ee\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u52a9\u60a8\uff1f"}];
+//浮动按钮样式
+div.style = `position: fixed; right:15px; top:${data[data.length - 1].margin_top}px;width:80px;background: #867c7c00;border-radius: 10px 0 0 10px;
+            display:flex;flex-direction: column; justify-content: space-between;z-index:1000;`;
+div.style.height = 80 * (data.length) + 'px';
+//拼接浮动按钮样式
+let btn_html = '';
+for (let i = 0; i < data.length - 1; i++) {
+  btn_html += `<div id='set_user_info_${data[i].group_id}' style="width:80px;height:80px;background:#9a949775;display:flex;
+                flex-direction: column;justify-content: center;align-items: center; cursor:pointer;z-index:1000; "> 
+                <img  id='set_user_img_${data[i].group_id}'src='${adminDomain}${data[i].image}'></img> 
+                <span id='set_user_span_${data[i].group_id}' style="font-size:12px;font-weight:bold; color: #f0f0f0;">${data[i].name}</span> </div>`;
+}
+div.innerHTML = btn_html;
+//延时显示提示框
+setTimeout(function () {
+  create_prompt_box();
+}, data[data.length - 1].stop_time * 1000);
+
+/***
+ * 打开会话窗口
+ */
+div.onclick =function(e){
+  console.log(window.location.href)
+  var index=e.target.id.lastIndexOf("_");
+  // console.log(e.target,index);
+  var group_id  = e.target.id.substring(index+1,e.target.id.length);
+  console.log(window);
+  if(appuip_user && appip_source){
+    openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user+'&group_id='+group_id,700,700);
+  }else{
+    openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user,700,700);
+  }
+}
+//将浮动按钮添加到对应到网站body上
+setTimeout(function(){
+  document.body.appendChild(div);
+}, 2000);
+
+
+
+
+/**
+ * 提示框样式
+ */
+function create_prompt_box(){
+  var popupWindowBox = document.createElement('div');
+  popupWindowBox.style = `position: fixed; top:35%; padding: 10px; left:45%;width:350px;height:160px;
+    background:#e5e5e5;border-radius:10px;font-size:17px;display:flex; flex-direction: column;
+    justify-content: space-between;z-index:9999;`;
+  //拼接提示框样式
+  popupWindowBox.innerHTML =`
+    <div style='display:flex;flex-direction: row;justify-content: center;'> 
+    <span style="font-weight:bold; color: #666666;">${data[data.length - 1].copywriting}</span> 
+    </div> 
+    <div style='flex-direction: row;display:flex;justify-content: flex-end;'>
+    <div id="$startSession" style='margin-right: 10px; padding: 4px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;'>开始会话</div>
+    <div id="$cancel" style="padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;">下次再说</div> 
+    </div> 
+    `;
+  popupWindowBox.onclick =function(e){
+    if(e.target.id == '$startSession'){
+      openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user,700,700);
+    }else if(e.target.id == '$cancel'){
+      popupWindowBox.style.display="none";
+    }
+  }
+
+
+  //将提示框添加到对应到网站body上
+  document.body.appendChild(popupWindowBox);
+}
+
+// padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;
+
+// /***
+//  *
+//  */
+// function   (){
+
+// }
+
+/**
+ * 打开一个居中的窗口
+ * @param pageUrl url链接
+ * @param innerWidth 宽度,不带px,小于0表示百分比
+ * @param innerHeight 高度,不带px,小于0表示百分比
+ */
+function openWindowCenter(pageUrl, innerWidth, innerHeight){
+  var screenWidth = screen.availWidth;
+  var screenHeight = screen.availHeight;
+  var width = screenWidth;
+  var height = screenHeight;
+
+  if(innerWidth < 1){
+    width = screenWidth * innerWidth;
+    screenWidth = (screen.availWidth - width)/2;
+  }else{
+    width = innerWidth;
+    screenWidth = (screen.availWidth - innerWidth)/2;
+  }
+  if(innerHeight < 1){
+    height = screenHeight * innerHeight;
+    screenHeight = (screen.availHeight - height)/2;
+  }else{
+    height = innerHeight;
+    screenHeight = (screen.availHeight - innerHeight)/2;
+  }
+  window.open(pageUrl, "", "left=" + screenWidth + ",top=" + screenHeight +",width=" + width + ",height=" + height + ",resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
+};
+
+
+//html页面调用
+/**
+ * 获取数据
+ */
+function set_user_info_js(a,b){
+  appip_source = a;
+  appuip_user=b;
+}
+
+//vue调用
+// export default {
+//     /**
+//      * 获取数据
+//      */
+//     set_user_info_vue: function (a,b){
+//         appip_source = a;
+//         appuip_user =b;
+//     }
+// }

+ 155 - 0
public/entranceJs/new/999.js

@@ -0,0 +1,155 @@
+var xmlhttp=new XMLHttpRequest();
+var data = [];//配置信息
+var appip_source = '';
+var appuip_user = '';
+var isIE=!!window.ActiveXObject;    //是否IE浏览器
+var isIE6=isIE&&!window.XMLHttpRequest;  //是否IE6浏览器
+var isIE7=isIE&&!isIE6&&!isIE8;  //是否IE7浏览器
+var isIE8=isIE&&!!document.documentMode;  //是否IE8浏览器
+var availheight = screen.availHeight;   //默认高度为屏幕的高度
+var hostname = location.protocol+'//'+location.host;
+var adminDomain = 'http://kfadmin.bocai186.com';   //服务器域名
+var serverDomain = 'http://kefu.bocai186.com';   //客服域名
+var userDomain = 'http://kf.bocai186.com?pid='+escape("~!@#¥%……&*()——+,./;\'[]");   //用户域名
+if(isIE8){
+  availheight= screen.height;
+}
+//IE11升级弹出窗口小
+if (!!window.ActiveXObject || "ActiveXObject" in window){
+  availheight= screen.height;
+}
+
+
+var div = document.createElement('div');
+
+data = [{"id":2,"name":"\u552e\u540e\u652f\u6301","image":"\/uploads\/20190809\/8005f8e4bd78904794f5b2eae54957b4.png","group_id":"2","sort":2},{"id":5,"name":"\u552e\u524d\u54a8\u8be2","image":"\/uploads\/20190809\/ce52fd990d35c4c100af6e1fbe708a55.png","group_id":"1","sort":3},{"id":6,"name":"\u5728\u7ebf\u5ba2\u670d","image":"\/uploads\/20190809\/233b8dce85c445b5dd3c092526146d9c.png","group_id":"all","sort":8},{"margin_top":"300","stop_time":"15","copywriting":"\u60a8\u597d\uff0c\u8bf7\u95ee\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u52a9\u60a8\uff1f"}];
+//浮动按钮样式
+div.style = `position: fixed; right:15px; top:${data[data.length - 1].margin_top}px;width:80px;background: #867c7c00;border-radius: 10px 0 0 10px;
+            display:flex;flex-direction: column; justify-content: space-between;z-index:1000;`;
+div.style.height = 80 * (data.length) + 'px';
+//拼接浮动按钮样式
+let btn_html = '';
+for (let i = 0; i < data.length - 1; i++) {
+  btn_html += `<div id='set_user_info_${data[i].group_id}' style="width:80px;height:80px;background:#9a949775;display:flex;
+                flex-direction: column;justify-content: center;align-items: center; cursor:pointer;z-index:1000; "> 
+                <img  id='set_user_img_${data[i].group_id}'src='${adminDomain}${data[i].image}'></img> 
+                <span id='set_user_span_${data[i].group_id}' style="font-size:12px;font-weight:bold; color: #f0f0f0;">${data[i].name}</span> </div>`;
+}
+div.innerHTML = btn_html;
+//延时显示提示框
+setTimeout(function () {
+  create_prompt_box();
+}, data[data.length - 1].stop_time * 1000);
+
+/***
+ * 打开会话窗口
+ */
+div.onclick =function(e){
+  console.log(window.location.href)
+  var index=e.target.id.lastIndexOf("_");
+  // console.log(e.target,index);
+  var group_id  = e.target.id.substring(index+1,e.target.id.length);
+  console.log(window);
+  if(appuip_user && appip_source){
+    openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user+'&group_id='+group_id,700,700);
+  }else{
+    openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user,700,700);
+  }
+}
+//将浮动按钮添加到对应到网站body上
+setTimeout(function(){
+  document.body.appendChild(div);
+}, 2000);
+
+
+
+
+/**
+ * 提示框样式
+ */
+function create_prompt_box(){
+  var popupWindowBox = document.createElement('div');
+  popupWindowBox.style = `position: fixed; top:35%; padding: 10px; left:45%;width:350px;height:160px;
+    background:#e5e5e5;border-radius:10px;font-size:17px;display:flex; flex-direction: column;
+    justify-content: space-between;z-index:9999;`;
+  //拼接提示框样式
+  popupWindowBox.innerHTML =`
+    <div style='display:flex;flex-direction: row;justify-content: center;'> 
+    <span style="font-weight:bold; color: #666666;">${data[data.length - 1].copywriting}</span> 
+    </div> 
+    <div style='flex-direction: row;display:flex;justify-content: flex-end;'>
+    <div id="$startSession" style='margin-right: 10px; padding: 4px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;'>开始会话</div>
+    <div id="$cancel" style="padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;">下次再说</div> 
+    </div> 
+    `;
+  popupWindowBox.onclick =function(e){
+    if(e.target.id == '$startSession'){
+      openWindowCenter(userDomain+"&appid="+appip_source+"&appuid="+appuip_user,700,700);
+    }else if(e.target.id == '$cancel'){
+      popupWindowBox.style.display="none";
+    }
+  }
+
+
+  //将提示框添加到对应到网站body上
+  document.body.appendChild(popupWindowBox);
+}
+
+// padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;
+
+// /***
+//  *
+//  */
+// function   (){
+
+// }
+
+/**
+ * 打开一个居中的窗口
+ * @param pageUrl url链接
+ * @param innerWidth 宽度,不带px,小于0表示百分比
+ * @param innerHeight 高度,不带px,小于0表示百分比
+ */
+function openWindowCenter(pageUrl, innerWidth, innerHeight){
+  var screenWidth = screen.availWidth;
+  var screenHeight = screen.availHeight;
+  var width = screenWidth;
+  var height = screenHeight;
+
+  if(innerWidth < 1){
+    width = screenWidth * innerWidth;
+    screenWidth = (screen.availWidth - width)/2;
+  }else{
+    width = innerWidth;
+    screenWidth = (screen.availWidth - innerWidth)/2;
+  }
+  if(innerHeight < 1){
+    height = screenHeight * innerHeight;
+    screenHeight = (screen.availHeight - height)/2;
+  }else{
+    height = innerHeight;
+    screenHeight = (screen.availHeight - innerHeight)/2;
+  }
+  window.open(pageUrl, "", "left=" + screenWidth + ",top=" + screenHeight +",width=" + width + ",height=" + height + ",resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
+};
+
+
+//html页面调用
+/**
+ * 获取数据
+ */
+function set_user_info_js(a,b){
+  appip_source = a;
+  appuip_user=b;
+}
+
+//vue调用
+// export default {
+//     /**
+//      * 获取数据
+//      */
+//     set_user_info_vue: function (a,b){
+//         appip_source = a;
+//         appuip_user =b;
+//     }
+// }

+ 155 - 0
public/entranceJs/new/ff.js

@@ -0,0 +1,155 @@
+var xmlhttp=new XMLHttpRequest();
+var data = [];//配置信息
+var appip_source = '';
+var appuip_user = '999';
+var isIE=!!window.ActiveXObject;    //是否IE浏览器
+var isIE6=isIE&&!window.XMLHttpRequest;  //是否IE6浏览器
+var isIE7=isIE&&!isIE6&&!isIE8;  //是否IE7浏览器
+var isIE8=isIE&&!!document.documentMode;  //是否IE8浏览器
+var availheight = screen.availHeight;   //默认高度为屏幕的高度
+var hostname = location.host;
+var adminDomain = 'kfadmin.bocai186.com';   //服务器域名
+var serverDomain = 'kefu.bocai186.com';   //客服域名
+var userDomain = 'kf.bocai186.com';   //用户域名
+if(isIE8){
+  availheight= screen.height;
+}
+//IE11升级弹出窗口小
+if (!!window.ActiveXObject || "ActiveXObject" in window){
+  availheight= screen.height;
+}
+
+
+var div = document.createElement('div');
+
+data = [{"id":2,"name":"\u552e\u540e\u652f\u6301","image":"\/uploads\/20190809\/8005f8e4bd78904794f5b2eae54957b4.png","group_id":"2","sort":2},{"id":5,"name":"\u552e\u524d\u54a8\u8be2","image":"\/uploads\/20190809\/ce52fd990d35c4c100af6e1fbe708a55.png","group_id":"1","sort":3},{"id":6,"name":"\u5728\u7ebf\u5ba2\u670d","image":"\/uploads\/20190809\/233b8dce85c445b5dd3c092526146d9c.png","group_id":"all","sort":8},{"margin_top":"300","stop_time":"15","copywriting":"\u60a8\u597d\uff0c\u8bf7\u95ee\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u52a9\u60a8\uff1f"}];
+//浮动按钮样式
+div.style = `position: fixed; right:15px; top:${data[data.length - 1].margin_top}px;width:80px;background: #867c7c00;border-radius: 10px 0 0 10px;
+            display:flex;flex-direction: column; justify-content: space-between;z-index:1000;`;
+div.style.height = 80 * (data.length) + 'px';
+//拼接浮动按钮样式
+let btn_html = '';
+for (let i = 0; i < data.length - 1; i++) {
+  btn_html += `<div id='set_user_info_${data[i].group_id}' style="width:80px;height:80px;background:#9a949775;display:flex;
+                flex-direction: column;justify-content: center;align-items: center; cursor:pointer;z-index:1000; "> 
+                <img  id='set_user_img_${data[i].group_id}'src='${adminDomain}${data[i].image}'></img> 
+                <span id='set_user_span_${data[i].group_id}' style="font-size:12px;font-weight:bold; color: #f0f0f0;">${data[i].name}</span> </div>`;
+}
+div.innerHTML = btn_html;
+//延时显示提示框
+setTimeout(function () {
+  create_prompt_box();
+}, data[data.length - 1].stop_time * 1000);
+
+/***
+ * 打开会话窗口
+ */
+div.onclick =function(e){
+  console.log(window.location.href)
+  var index=e.target.id.lastIndexOf("_");
+  // console.log(e.target,index);
+  var group_id  = e.target.id.substring(index+1,e.target.id.length);
+  console.log(window);
+  if(group_id != 'all'){
+    openWindowCenter(userDomain+"/?appid="+appip_source+"&appuid="+appuip_user+'&group_id='+group_id,700,700);
+  }else{
+    openWindowCenter(userDomain+"/?appid="+appip_source+"&appuid="+appuip_user,700,700);
+  }
+}
+//将浮动按钮添加到对应到网站body上
+setTimeout(function(){
+  document.body.appendChild(div);
+}, 2000);
+
+
+
+
+/**
+ * 提示框样式
+ */
+function create_prompt_box(){
+  var popupWindowBox = document.createElement('div');
+  popupWindowBox.style = `position: fixed; top:35%; padding: 10px; left:45%;width:350px;height:160px;
+    background:#e5e5e5;border-radius:10px;font-size:17px;display:flex; flex-direction: column;
+    justify-content: space-between;z-index:9999;`;
+  //拼接提示框样式
+  popupWindowBox.innerHTML =`
+    <div style='display:flex;flex-direction: row;justify-content: center;'> 
+    <span style="font-weight:bold; color: #666666;">${data[data.length - 1].copywriting}</span> 
+    </div> 
+    <div style='flex-direction: row;display:flex;justify-content: flex-end;'>
+    <div id="$startSession" style='margin-right: 10px; padding: 4px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;'>开始会话</div>
+    <div id="$cancel" style="padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;">下次再说</div> 
+    </div> 
+    `;
+  popupWindowBox.onclick =function(e){
+    if(e.target.id == '$startSession'){
+      openWindowCenter(userDomain+"/?appid="+appip_source+"&appuid="+appuip_user,700,700);
+    }else if(e.target.id == '$cancel'){
+      popupWindowBox.style.display="none";
+    }
+  }
+
+
+  //将提示框添加到对应到网站body上
+  document.body.appendChild(popupWindowBox);
+}
+
+// padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;
+
+// /***
+//  *
+//  */
+// function   (){
+
+// }
+
+/**
+ * 打开一个居中的窗口
+ * @param pageUrl url链接
+ * @param innerWidth 宽度,不带px,小于0表示百分比
+ * @param innerHeight 高度,不带px,小于0表示百分比
+ */
+function openWindowCenter(pageUrl, innerWidth, innerHeight){
+  var screenWidth = screen.availWidth;
+  var screenHeight = screen.availHeight;
+  var width = screenWidth;
+  var height = screenHeight;
+
+  if(innerWidth < 1){
+    width = screenWidth * innerWidth;
+    screenWidth = (screen.availWidth - width)/2;
+  }else{
+    width = innerWidth;
+    screenWidth = (screen.availWidth - innerWidth)/2;
+  }
+  if(innerHeight < 1){
+    height = screenHeight * innerHeight;
+    screenHeight = (screen.availHeight - height)/2;
+  }else{
+    height = innerHeight;
+    screenHeight = (screen.availHeight - innerHeight)/2;
+  }
+  window.open(pageUrl, "", "left=" + screenWidth + ",top=" + screenHeight +",width=" + width + ",height=" + height + ",resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
+};
+
+
+//html页面调用
+/**
+ * 获取数据
+ */
+function set_user_info_js(a,b){
+  appip_source = a;
+  appuip_user=b;
+}
+
+//vue调用
+// export default {
+//     /**
+//      * 获取数据
+//      */
+//     set_user_info_vue: function (a,b){
+//         appip_source = a;
+//         appuip_user =b;
+//     }
+// }

+ 155 - 0
public/entranceJs/new/rrrr.js

@@ -0,0 +1,155 @@
+var xmlhttp=new XMLHttpRequest();
+var data = [];//配置信息
+var appip_source = '';
+var appuip_user = '999';
+var isIE=!!window.ActiveXObject;    //是否IE浏览器
+var isIE6=isIE&&!window.XMLHttpRequest;  //是否IE6浏览器
+var isIE7=isIE&&!isIE6&&!isIE8;  //是否IE7浏览器
+var isIE8=isIE&&!!document.documentMode;  //是否IE8浏览器
+var availheight = screen.availHeight;   //默认高度为屏幕的高度
+var hostname = location.host;
+var adminDomain = 'kfadmin.bocai186.com';   //服务器域名
+var serverDomain = 'kefu.bocai186.com';   //客服域名
+var userDomain = 'kf.bocai186.com';   //用户域名
+if(isIE8){
+  availheight= screen.height;
+}
+//IE11升级弹出窗口小
+if (!!window.ActiveXObject || "ActiveXObject" in window){
+  availheight= screen.height;
+}
+
+
+var div = document.createElement('div');
+
+data = [{"id":2,"name":"\u552e\u540e\u652f\u6301","image":"\/uploads\/20190809\/8005f8e4bd78904794f5b2eae54957b4.png","group_id":"2","sort":2},{"id":5,"name":"\u552e\u524d\u54a8\u8be2","image":"\/uploads\/20190809\/ce52fd990d35c4c100af6e1fbe708a55.png","group_id":"1","sort":3},{"id":6,"name":"\u5728\u7ebf\u5ba2\u670d","image":"\/uploads\/20190809\/233b8dce85c445b5dd3c092526146d9c.png","group_id":"all","sort":8},{"margin_top":"300","stop_time":"15","copywriting":"\u60a8\u597d\uff0c\u8bf7\u95ee\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u52a9\u60a8\uff1f"}];
+//浮动按钮样式
+div.style = `position: fixed; right:15px; top:${data[data.length - 1].margin_top}px;width:80px;background: #867c7c00;border-radius: 10px 0 0 10px;
+            display:flex;flex-direction: column; justify-content: space-between;z-index:1000;`;
+div.style.height = 80 * (data.length) + 'px';
+//拼接浮动按钮样式
+let btn_html = '';
+for (let i = 0; i < data.length - 1; i++) {
+  btn_html += `<div id='set_user_info_${data[i].group_id}' style="width:80px;height:80px;background:#9a949775;display:flex;
+                flex-direction: column;justify-content: center;align-items: center; cursor:pointer;z-index:1000; "> 
+                <img  id='set_user_img_${data[i].group_id}'src='${adminDomain}${data[i].image}'></img> 
+                <span id='set_user_span_${data[i].group_id}' style="font-size:12px;font-weight:bold; color: #f0f0f0;">${data[i].name}</span> </div>`;
+}
+div.innerHTML = btn_html;
+//延时显示提示框
+setTimeout(function () {
+  create_prompt_box();
+}, data[data.length - 1].stop_time * 1000);
+
+/***
+ * 打开会话窗口
+ */
+div.onclick =function(e){
+  console.log(window.location.href)
+  var index=e.target.id.lastIndexOf("_");
+  // console.log(e.target,index);
+  var group_id  = e.target.id.substring(index+1,e.target.id.length);
+  console.log(window);
+  if(group_id != 'all'){
+    openWindowCenter(userDomain+"/?appid="+appip_source+"&appuid="+appuip_user+'&group_id='+group_id,700,700);
+  }else{
+    openWindowCenter(userDomain+"/?appid="+appip_source+"&appuid="+appuip_user,700,700);
+  }
+}
+//将浮动按钮添加到对应到网站body上
+setTimeout(function(){
+  document.body.appendChild(div);
+}, 2000);
+
+
+
+
+/**
+ * 提示框样式
+ */
+function create_prompt_box(){
+  var popupWindowBox = document.createElement('div');
+  popupWindowBox.style = `position: fixed; top:35%; padding: 10px; left:45%;width:350px;height:160px;
+    background:#e5e5e5;border-radius:10px;font-size:17px;display:flex; flex-direction: column;
+    justify-content: space-between;z-index:9999;`;
+  //拼接提示框样式
+  popupWindowBox.innerHTML =`
+    <div style='display:flex;flex-direction: row;justify-content: center;'> 
+    <span style="font-weight:bold; color: #666666;">${data[data.length - 1].copywriting}</span> 
+    </div> 
+    <div style='flex-direction: row;display:flex;justify-content: flex-end;'>
+    <div id="$startSession" style='margin-right: 10px; padding: 4px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;'>开始会话</div>
+    <div id="$cancel" style="padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;cursor:pointer;">下次再说</div> 
+    </div> 
+    `;
+  popupWindowBox.onclick =function(e){
+    if(e.target.id == '$startSession'){
+      openWindowCenter(userDomain+"/?appid="+appip_source+"&appuid="+appuip_user,700,700);
+    }else if(e.target.id == '$cancel'){
+      popupWindowBox.style.display="none";
+    }
+  }
+
+
+  //将提示框添加到对应到网站body上
+  document.body.appendChild(popupWindowBox);
+}
+
+// padding: 3px;border: 1px solid #999; border-radius: 4px; color: #666666;font-weight: bold;
+
+// /***
+//  *
+//  */
+// function   (){
+
+// }
+
+/**
+ * 打开一个居中的窗口
+ * @param pageUrl url链接
+ * @param innerWidth 宽度,不带px,小于0表示百分比
+ * @param innerHeight 高度,不带px,小于0表示百分比
+ */
+function openWindowCenter(pageUrl, innerWidth, innerHeight){
+  var screenWidth = screen.availWidth;
+  var screenHeight = screen.availHeight;
+  var width = screenWidth;
+  var height = screenHeight;
+
+  if(innerWidth < 1){
+    width = screenWidth * innerWidth;
+    screenWidth = (screen.availWidth - width)/2;
+  }else{
+    width = innerWidth;
+    screenWidth = (screen.availWidth - innerWidth)/2;
+  }
+  if(innerHeight < 1){
+    height = screenHeight * innerHeight;
+    screenHeight = (screen.availHeight - height)/2;
+  }else{
+    height = innerHeight;
+    screenHeight = (screen.availHeight - innerHeight)/2;
+  }
+  window.open(pageUrl, "", "left=" + screenWidth + ",top=" + screenHeight +",width=" + width + ",height=" + height + ",resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
+};
+
+
+//html页面调用
+/**
+ * 获取数据
+ */
+function set_user_info_js(a,b){
+  appip_source = a;
+  appuip_user=b;
+}
+
+//vue调用
+// export default {
+//     /**
+//      * 获取数据
+//      */
+//     set_user_info_vue: function (a,b){
+//         appip_source = a;
+//         appuip_user =b;
+//     }
+// }

+ 1 - 0
public/entranceJs/请勿修改FloatingButton.txt

@@ -0,0 +1 @@
+该文件为js生成基础文件,若修改可能会造成系统生成js文件错误,请慎重!!!

+ 2 - 2
vendor/GatewayWorker_windows/Applications/whisper/start_gateway.php

@@ -57,8 +57,8 @@ $gateway->onConnect = function ($connection) {
         $getToken = isset($_GET['apiToken']) ? $_GET['apiToken'] : '';
 
         if ($getToken !== $apiToken) {
-            //$connection->close();
-            //return;
+            $connection->close();
+            return;
         }
         $_SESSION['remotip'] = $connection->getRemoteIp();
         $_SESSION['remotport'] = $connection->getRemotePort();