处理头像

pull/30/head
taoshihan1991 4 years ago
parent 354e3562d6
commit 31bebb2b3e

@ -109,7 +109,7 @@ func sendPingToClient() {
SendNoticeToAllKefu() SendNoticeToAllKefu()
} }
} }
time.Sleep(10 * time.Second) time.Sleep(3 * time.Second)
} }
}() }()
@ -124,7 +124,7 @@ func sendPingUpdateStatus() {
models.UpdateVisitorStatus(visitor.VisitorId,0) models.UpdateVisitorStatus(visitor.VisitorId,0)
} }
} }
time.Sleep(10 * time.Second) time.Sleep(20 * time.Second)
} }
} }
//定时推送当前在线用户 //定时推送当前在线用户
@ -146,7 +146,7 @@ func sendPingOnlineUsers() {
for _, kfConn := range kefuList { for _, kfConn := range kefuList {
kfConn.WriteMessage(websocket.TextMessage,str) kfConn.WriteMessage(websocket.TextMessage,str)
} }
time.Sleep(10 * time.Second) time.Sleep(3 * time.Second)
} }
} }
func SendNoticeToAllKefu() { func SendNoticeToAllKefu() {
@ -167,7 +167,7 @@ func SendNoticeToAllKefu() {
func singleBroadcaster(){ func singleBroadcaster(){
for { for {
message:=<-message message:=<-message
log.Println("debug:",message) //log.Println("debug:",message)
var typeMsg TypeMessage var typeMsg TypeMessage
var clientMsg ClientMessage var clientMsg ClientMessage

@ -15,6 +15,7 @@ func main() {
log.Println("start server...\r\ngohttp://" + baseServer) log.Println("start server...\r\ngohttp://" + baseServer)
engine := gin.Default() engine := gin.Default()
engine.LoadHTMLGlob("static/html/*") engine.LoadHTMLGlob("static/html/*")
engine.Static("/static", "./static")
//首页 //首页
engine.GET("/", controller.Index) engine.GET("/", controller.Index)
//登陆界面 //登陆界面

@ -13,8 +13,10 @@
<style> <style>
html, body {height: 100%;padding: 0;margin: 0;background-color: #f5f5f5;} html, body {height: 100%;padding: 0;margin: 0;background-color: #f5f5f5;}
.el-row{width:100%}#app{margin-top: 10px;} .el-row{width:100%}#app{margin-top: 10px;}
.chatLeft{min-height: 100%;background: #fff;border: solid 1px #e6e6e6;overflow: hidden;} .chatBg{min-height: 100%;background: #fff;border: solid 1px #e6e6e6;overflow: hidden;}
.chatLeft{ margin-left: 4px;}
.chatLeft .el-tabs__header{margin: 0;} .chatLeft .el-tabs__header{margin: 0;}
.chatLeft .el-tabs__nav{margin-left: 20px;}
.sw-bg{background: #fff;border: solid 1px #e6e6e6;boder-top:none;padding:5px 10px;} .sw-bg{background: #fff;border: solid 1px #e6e6e6;boder-top:none;padding:5px 10px;}
.chatContext .el-row{margin-bottom: 5px;} .chatContext .el-row{margin-bottom: 5px;}
.chatUser{ .chatUser{
@ -63,9 +65,9 @@
<body> <body>
<div id="app"> <div id="app">
<template> <template>
<el-row :gutter="5"> <el-row :gutter="2">
<el-col :span="6"> <el-col :span="6">
<div class="chatLeft"> <div class="chatBg chatLeft">
<el-tabs v-model="leftTabActive" @tab-click="handleTabClick"> <el-tabs v-model="leftTabActive" @tab-click="handleTabClick">
<el-tab-pane label="在线用户" name="first"> <el-tab-pane label="在线用户" name="first">
<el-row v-for="item in users" :key="item.uid" class=""> <el-row v-for="item in users" :key="item.uid" class="">
@ -113,7 +115,8 @@
<el-button type="primary" v-on:click="chatToUser">发送</el-button> <el-button type="primary" v-on:click="chatToUser">发送</el-button>
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="chatLeft"> <el-col :span="6">
<div class="chatBg">
<el-menu> <el-menu>
<el-menu-item> <el-menu-item>
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
@ -136,6 +139,7 @@
<span slot="title">状态:<{visitor.status}></span> <span slot="title">状态:<{visitor.status}></span>
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
</div>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
@ -332,10 +336,11 @@
"token":localStorage.getItem("token") "token":localStorage.getItem("token")
}, },
success: function(data) { success: function(data) {
if(data.result!=null){ if(data.code==200 && data.result!=null){
_this.kfConfig.id=data.result.id; _this.kfConfig.id=data.result.id;
_this.kfConfig.name=data.result.name; _this.kfConfig.name=data.result.name;
_this.kfConfig.avator=data.result.avator; _this.kfConfig.avator=data.result.avator;
_this.initConn();
} }
if(data.code!=200){ if(data.code!=200){
_this.$message({ _this.$message({
@ -345,7 +350,7 @@
} }
} }
}).then(function(data){ }).then(function(data){
_this.initConn();
}); });
}, },
//获取客服信息 //获取客服信息

@ -103,7 +103,7 @@
var guest={}; var guest={};
guest.id = ""; guest.id = "";
guest.name = typeof(returnCitySN)!="undefined" ?returnCitySN["cip"]+"-"+returnCitySN["cname"]:"小米"; guest.name = typeof(returnCitySN)!="undefined" ?returnCitySN["cip"]+"-"+returnCitySN["cname"]:"小米";
guest.avator = "https://www.wolive.cc/assets/upload/"+Math.floor(Math.random()*10)+".jpg"; guest.avator = "/static/images/"+Math.floor(Math.random()*(14-0+1)+0)+".jpg";
guest.group = "1"; guest.group = "1";
guest.to_id=""; guest.to_id="";

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Loading…
Cancel
Save