diff --git a/contact-center/app/src/main/resources/templates/apps/contacts/detail.pug b/contact-center/app/src/main/resources/templates/apps/contacts/detail.pug index 6616ea39..f8ca4d80 100644 --- a/contact-center/app/src/main/resources/templates/apps/contacts/detail.pug +++ b/contact-center/app/src/main/resources/templates/apps/contacts/detail.pug @@ -181,6 +181,20 @@ block content } script. + function escapeHtml (str) { + if (typeof str == 'string') { + return str.replace(/<|&|>/g, function (matches) { + return ({ + '<': '<', + '>': '>', + '&': '&' + })[matches]; + }); + } + + return ''; + } + function getNotesByContactId () { // 获取数据 var id = $('#contactsId').val(); @@ -204,8 +218,8 @@ block content '
' + '

时间:' + item.updatetime + '

' + '
笔记者:' + item.creatername + '
' + - '
事件类型:' + item.category + '
' + - '
笔记:' + item.content + '
' + + '
事件类型:' + escapeHtml(item.category) + '
' + + '
笔记:' + escapeHtml(item.content) + '
' + '
' + ''); }