Compare commits
No commits in common. "838398d3129e715da81152e13caff92e2e2b5c5e" and "447e367842d331dc4ad17068fddac6bc349b13b8" have entirely different histories.
838398d312
...
447e367842
@ -12,7 +12,6 @@ var (
|
||||
Version string = "0.3.9"
|
||||
VisitorExpire float64 = 600
|
||||
Upload string = "static/upload/"
|
||||
ApiPrefix string = "aicss/"
|
||||
Dir string = "config/"
|
||||
MysqlConf string = Dir + "mysql.json"
|
||||
IsCompireTemplate bool = false //是否编译静态模板到二进制
|
||||
|
||||
@ -313,7 +313,7 @@ func UploadImg(c *gin.Context) {
|
||||
"code": 200,
|
||||
"msg": "上传成功!",
|
||||
"result": gin.H{
|
||||
"path": path.Join(common.ApiPrefix, filepath),
|
||||
"path": filepath,
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -349,7 +349,7 @@ func UploadFile(c *gin.Context) {
|
||||
"code": 200,
|
||||
"msg": "上传成功!",
|
||||
"result": gin.H{
|
||||
"path": path.Join(common.ApiPrefix, filepath),
|
||||
"path": filepath,
|
||||
"ext": fileExt,
|
||||
"size": f.Size,
|
||||
"name": f.Filename,
|
||||
|
||||
@ -784,28 +784,24 @@
|
||||
pagesize: 20,
|
||||
visitor_id: _this.currentGuest,
|
||||
}
|
||||
$.get("/aicss/2/messagesPages",params,function(res){
|
||||
$.get("/ai-css/2/messagesPages",params,function(res){
|
||||
let msgList=res.result.list;
|
||||
let existIds={};
|
||||
var existList=[];
|
||||
let existKeys={};
|
||||
for(let i=0;i<_this.msgList.length;i++){
|
||||
var m=_this.msgList[i];
|
||||
if(m.id) existIds[m.id]=true;
|
||||
if(m.time) existList.push({time:new Date(m.time).getTime(),content:m.content});
|
||||
}
|
||||
function isDuplicate(item){
|
||||
if(item.id && existIds[item.id]) return true;
|
||||
var t=new Date(item["create_time"]).getTime();
|
||||
var c=replaceContent(item["content"]);
|
||||
for(var j=0;j<existList.length;j++){
|
||||
if(existList[j].content===c && Math.abs(existList[j].time-t)<=3000) return true;
|
||||
if(m.id){
|
||||
existKeys['id_'+m.id]=true;
|
||||
}
|
||||
if(m.time && m.content){
|
||||
existKeys[m.time+'_'+m.content]=true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
let newMsgs=[];
|
||||
for(let i=msgList.length-1;i>=0;i--){
|
||||
let item=msgList[i];
|
||||
if(isDuplicate(item)) continue;
|
||||
var key1=item.id?'id_'+item.id:'';
|
||||
var key2=item["create_time"]+'_'+replaceContent(item["content"]);
|
||||
if((key1 && existKeys[key1]) || existKeys[key2]) continue;
|
||||
if (item["mes_type"] == "kefu") {
|
||||
item.is_kefu = true;
|
||||
item.avator=item["kefu_avator"];
|
||||
|
||||
@ -129,10 +129,10 @@
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip content="Upload image" placement="top">
|
||||
<div class="iconBtn el-icon-picture" id="uploadImg" v-on:click="uploadImg('/aicss/uploadimg')" style="font-size: 20px;"></div>
|
||||
<div class="iconBtn el-icon-picture" id="uploadImg" v-on:click="uploadImg('/uploadimg')" style="font-size: 20px;"></div>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="Upload file" placement="top">
|
||||
<div class="iconBtn el-icon-upload" id="uploadFile" v-on:click="uploadFile('/aicss/uploadfile')" style="font-size: 20px;"></div>
|
||||
<div class="iconBtn el-icon-upload" id="uploadFile" v-on:click="uploadFile('/uploadfile')" style="font-size: 20px;"></div>
|
||||
</el-tooltip>
|
||||
|
||||
<div style="display: none" title="Emoji" class="icono-smile visitorIconBtns visitorFaceBtn"></div>
|
||||
@ -238,6 +238,7 @@
|
||||
isIframe:false,
|
||||
kefuInfo:{},
|
||||
showLoadMore:false,
|
||||
pollTimer:null,
|
||||
messages:{
|
||||
page:1,
|
||||
pagesize:5,
|
||||
@ -462,6 +463,7 @@
|
||||
}
|
||||
if(_this.messages.page==1){
|
||||
_this.scrollBottom();
|
||||
_this.startPollMessages();
|
||||
}
|
||||
_this.messages.page++;
|
||||
});
|
||||
@ -476,7 +478,7 @@
|
||||
pagesize: 20,
|
||||
visitor_id: _this.visitor.visitor_id,
|
||||
}
|
||||
$.get("/aicss/2/messagesPages",params,function(res){
|
||||
$.get("/ai-css/2/messagesPages",params,function(res){
|
||||
let msgList=res.result.list;
|
||||
let existKeys={};
|
||||
for(let i=0;i<_this.msgList.length;i++){
|
||||
@ -763,6 +765,12 @@
|
||||
this.scrollBottom();
|
||||
},
|
||||
},
|
||||
beforeDestroy:function(){
|
||||
if(this.pollTimer){
|
||||
clearInterval(this.pollTimer);
|
||||
this.pollTimer=null;
|
||||
}
|
||||
},
|
||||
mounted:function() {
|
||||
document.addEventListener('paste', this.onPasteUpload)
|
||||
document.addEventListener('scroll',this.textareaBlur)
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
<el-form-item label="Upload New Avatar">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/aicss/uploadimg"
|
||||
action="/uploadimg"
|
||||
:show-file-list="false"
|
||||
name="imgfile"
|
||||
:on-success="handleAvatarSuccess"
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<el-form-item label="新头像">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/aicss/uploadimg"
|
||||
action="/uploadimg"
|
||||
:show-file-list="false"
|
||||
name="imgfile"
|
||||
:on-success="handleAvatarSuccess"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user