电脑后台客服端引入
script type="module" crossorigin src="https://zyue.ltd/static/wechat/chat.js?appkey=*******"
link rel="stylesheet" crossorigin href="https://zyue.ltd/static/wechat/assets/chat.css"
API协议
ws:zyue.ltd:8989
ws连接上后发送
{
type:'login',
data:{
appkey:"*******"
}
}
连接成功之后
{
type:"", // login(连接登录) | chat(互发消息) | 其他自定义type 对方会收到这个type
data:{ // 自定义data属性
appkey:"****" //type为login 需要传入 appkey
},
uid:123, //当前发送消息人的id
to_uid:456 //接收消息人id 客服固定id为1
}