From 44a20cd6b03a5a4f2085f7d1536fb3068869cc17 Mon Sep 17 00:00:00 2001 From: Yu Date: Wed, 17 Mar 2021 18:12:20 +0800 Subject: [PATCH] fix #421 encode im inject url --- README.md | 2 +- contact-center/Dockerfile | 4 ++-- .../cc/controller/apps/IMController.java | 2 +- .../resources/templates/apps/im/index.pug | 22 +------------------ 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 77b43955..37b0eed4 100644 --- a/README.md +++ b/README.md @@ -294,4 +294,4 @@ Chatopera 机器人平台包括知识库、多轮对话、意图识别和语音 -

+

\ No newline at end of file diff --git a/contact-center/Dockerfile b/contact-center/Dockerfile index 2094f8ae..404a8647 100644 --- a/contact-center/Dockerfile +++ b/contact-center/Dockerfile @@ -10,7 +10,7 @@ ENV APPLICATION_CUSTOMER_ENTITY=$APPLICATION_CUSTOMER_ENTITY ENV APPLICATION_BUILD_DATESTR=$APPLICATION_BUILD_DATESTR LABEL org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/chatopera/cosin" + org.label-schema.vcs-url="https://github.com/chatopera/cskefu" # COPY $PWD/assets/aliyun.sources.list /etc/apt/sources.list # install amazon jdk corretto @@ -47,4 +47,4 @@ RUN chmod +x /opt/chatopera/*.sh WORKDIR /opt/chatopera EXPOSE 8030-8050 -CMD ["./docker-entrypoint.sh"] \ No newline at end of file +CMD ["./docker-entrypoint.sh"] diff --git a/contact-center/app/src/main/java/com/chatopera/cc/controller/apps/IMController.java b/contact-center/app/src/main/java/com/chatopera/cc/controller/apps/IMController.java index eebab5c3..505252ba 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/controller/apps/IMController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/controller/apps/IMController.java @@ -696,7 +696,7 @@ public class IMController extends Handler { map.addAttribute("title", title); } if (StringUtils.isNotBlank(traceid)) { - map.addAttribute("url", url); + map.addAttribute("url", URLEncoder.encode(url,"utf-8")); } map.addAttribute("cskefuport", request.getServerPort()); diff --git a/contact-center/app/src/main/resources/templates/apps/im/index.pug b/contact-center/app/src/main/resources/templates/apps/im/index.pug index 25cc7ba5..7bce3930 100644 --- a/contact-center/app/src/main/resources/templates/apps/im/index.pug +++ b/contact-center/app/src/main/resources/templates/apps/im/index.pug @@ -15,7 +15,6 @@ html script(src='/js/jquery-1.10.2.min.js') script(type='text/javascript', src='/im/js/kindeditor/kindeditor.js') script(type='text/javascript', src='/im/js/kindeditor/lang/zh-CN.js') - script(type='text/javascript', src='/im/js/html2canvas.js') script(src='/im/js/socket.io.js') script(src='/im/js/dayjs.min.js') script(type='text/javascript'). @@ -25,11 +24,10 @@ html newmessage['mp3'] = '/images/message.mp3'; ring['mp3'] = '/images/ring.mp3'; KindEditor.lang({ - html2canvas: '截图', evaluation: '满意度评价' }); KindEditor.ready(function (K) { - var items = ['emoticons', 'image', 'insertfile', 'html2canvas', 'evaluation']; + var items = ['emoticons', 'image', 'insertfile', 'evaluation']; if (window.opener == null) { items = ['emoticons', 'image', 'insertfile', 'evaluation']; } @@ -48,7 +46,6 @@ html filterMode: true, items: items, - // items: ['emoticons', 'image', 'html2canvas'], //w4l客户需求,访客不允许上传文件 htmlTags: { img: ['src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'], br: [] @@ -159,16 +156,6 @@ html }); }); - KindEditor.plugin('html2canvas', function (K) { - var editor = this, name = 'html2canvas'; - editor.clickToolbar(name, function () { - if (window.opener != null) { - window.opener.postMessage('screenshots', "*"); - } else { - alert('无法截图,请打开页面') - } - }); - }); KindEditor.options.cssData = "body { font-size: 15px; font-family:'Microsoft Yahei', 'Helvetica', 'Simsun', 'Arial';}"; var R3Ajax = { ajax: function (opt) { @@ -352,13 +339,6 @@ html // kindeditor style. - .ke-icon-html2canvas { - background-image: url(img/cutimage.png); - background-position: 0px 0px; - width: 16px; - height: 16px; - } - .ke-icon-evaluation { background-image: url(img/evaluationa.png); background-position: 0px 0px;