From f79186716e360ec9d9c6e6c96b7653cdff535c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B6=E5=A3=AB=E6=B6=B5?= <630892807@qq.com> Date: Thu, 18 Feb 2021 23:24:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=89=A9=E5=B1=95=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/visitors.go | 5 +++-- static/js/chat-main.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/models/visitors.go b/models/visitors.go index 63d0b76..6252219 100644 --- a/models/visitors.go +++ b/models/visitors.go @@ -18,7 +18,7 @@ func CreateVisitor(name, avator, sourceIp, toId, visitorId, refer, city, clientI old := FindVisitorByVistorId(visitorId) if old.Name != "" { //更新状态上线 - UpdateVisitor(visitorId, 1, clientIp, sourceIp, refer) + UpdateVisitor(visitorId, 1, clientIp, sourceIp, refer, extra) return } v := &Visitor{ @@ -67,12 +67,13 @@ func UpdateVisitorStatus(visitorId string, status uint) { visitor := Visitor{} DB.Model(&visitor).Where("visitor_id = ?", visitorId).Update("status", status) } -func UpdateVisitor(visitorId string, status uint, clientIp string, sourceIp string, refer string) { +func UpdateVisitor(visitorId string, status uint, clientIp string, sourceIp string, refer, extra string) { visitor := &Visitor{ Status: status, ClientIp: clientIp, SourceIp: sourceIp, Refer: refer, + Extra: extra, } DB.Model(visitor).Where("visitor_id = ?", visitorId).Update(visitor) } diff --git a/static/js/chat-main.js b/static/js/chat-main.js index 1b0d2cc..512f4d9 100644 --- a/static/js/chat-main.js +++ b/static/js/chat-main.js @@ -382,6 +382,7 @@ var app=new Vue({ //_this.visitor.visitor_id=r.visitor_id; _this.chatTitle="#"+r.id+"|"+r.name; _this.chatTitleType="success"; + _this.visitorExtra=[]; if(r.extra!=""){ var extra=JSON.parse(b64ToUtf8(r.extra)); for(var key in extra){