1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-08-01 16:38:02 +08:00

更新网站接入聊天控件文档

Samurais 2018-09-27 11:19:40 +08:00
parent 74b27269c4
commit f9f64768ca

@ -1,11 +1,14 @@
# 春松客服-模拟访客端 # 春松客服-模拟访客端
本文档介绍如何测试网页端访客程序,假设服务是自动在本地 http://localhost:8035 端口。
## 网站渠道 ## 网站渠道
登录演示系统 ### 创建网站渠道
``` ```
http://cc.chatopera.com/ http://localhost:8035/
用户名admin 用户名admin
密码admin1234 密码admin1234
``` ```
@ -15,9 +18,33 @@ http://cc.chatopera.com/
![image](https://user-images.githubusercontent.com/3538629/45284166-64cd1200-b512-11e8-9c48-f66c5617fe12.png) ![image](https://user-images.githubusercontent.com/3538629/45284166-64cd1200-b512-11e8-9c48-f66c5617fe12.png)
## 网页 **注意**:网站地址为 *localhost*
复制下面的代码,保存为 ```cos-client.html``` 文件然后放在http服务下作为静态资源访问。 ### 访问测试程序
浏览器打开
```
http://localhost:8035/testclient.html
```
![image](https://user-images.githubusercontent.com/3538629/45284349-e1f88700-b512-11e8-80e9-a6204ec91b75.png)
### 网站留言
如果当前系统中没有"在线"并且"就绪"的客服人员,则进入留言。
## 嵌入代码到网站中
在目标接入访客聊天控件的网站中网页HTML的header中加入一行代码就可以访问了代码
```
<script defer="true" src="http://春松客服地址[:端口]/im/网站渠道标识.html"></script>
```
**注意**如果使用80或443端口可省略端口。
HTML示例
``` ```
<!DOCTYPE html> <!DOCTYPE html>
@ -38,19 +65,3 @@ http://cc.chatopera.com/
``` ```
如果是私有部署,参考下图修改上面的代码。
![image](https://user-images.githubusercontent.com/3538629/46003418-13607d80-c0e3-11e8-8ee3-87ceca176d1d.png)
从浏览器中,打开 "http://服务地址:服务端口/路径/cos-client.html" 查看“聊天控件”。
![image](https://user-images.githubusercontent.com/3538629/45284248-9514b080-b512-11e8-85ba-e9ca69913699.png)
## 网站咨询
![image](https://user-images.githubusercontent.com/3538629/45284349-e1f88700-b512-11e8-80e9-a6204ec91b75.png)
## 网站留言
如果当前系统中没有"在线"并且"就绪"的客服人员,则进入留言。