diff --git a/static/js/chat-page.js b/static/js/chat-page.js index 29ef7ab..f50cb92 100644 --- a/static/js/chat-page.js +++ b/static/js/chat-page.js @@ -151,7 +151,7 @@ new Vue({ type:"get", url:"/messages?visitorId="+this.visitor.visitor_id, success: function(data) { - if(data.code==200 && data.result!=null){ + if(data.code==200 && data.result!=null&&data.result.length!=0){ let msgList=data.result; _this.msgList=[]; for(let i=0;i { + $(".chatBox").append("
—— 以上是历史消息 ——
"); + }); } if(data.code!=200){ _this.$message({ @@ -205,15 +208,6 @@ new Vue({ },getCache : function (key){ return JSON.parse(localStorage.getItem(key)); }, - generateUUID:function () { - var d = new Date().getTime(); - var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { - var r = (d + Math.random()*16)%16 | 0; - d = Math.floor(d/16); - return (c=='x' ? r : (r&0x3|0x8)).toString(16); - }); - return uuid; - }, //获取自动欢迎语句 getNotice : function (){ let _this=this;