更新ip和refer来源

pull/30/head
陶士涵 4 years ago
parent e8747444f7
commit 3a752daf32

@ -16,7 +16,7 @@ func CreateVisitor(name string,avator string,sourceIp string,toId string,visitor
old:=FindVisitorByVistorId(visitorId)
if old.Name!=""{
//更新状态上线
UpdateVisitorStatus(visitorId,1)
UpdateVisitor(visitorId,1,clientIp,sourceIp,refer)
return
}
v:=&Visitor{
@ -65,6 +65,16 @@ func UpdateVisitorStatus(visitorId string,status uint){
}
DB.Model(&visitor).Where("visitor_id = ?",visitorId).Update("status", status)
}
func UpdateVisitor(visitorId string,status uint,clientIp string,sourceIp string,refer string){
visitor:=&Visitor{
Status: status,
ClientIp: clientIp,
SourceIp: sourceIp,
Refer: refer,
}
DB.Model(visitor).Where("visitor_id = ?",visitorId).Update(visitor)
}
//查询条数
func CountVisitors()uint{
var count uint

@ -153,7 +153,7 @@
<span slot="title">IP<{visitor.client_ip}></span>
</el-menu-item>
</el-tooltip>
<el-menu-item style="padding-left:2px;">
<el-menu-item v-on:click="openUrl('https://www.baidu.com/s?wd='+visitor.client_ip)" style="padding-left:2px;">
<i class="el-icon-s-tools"></i>
<span slot="title">城市:<{visitor.city}></span>
</el-menu-item>
@ -650,6 +650,9 @@
}
});
},
openUrl(url){
window.open(url);
},
},
created: function () {
//jquery

Loading…
Cancel
Save