You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
2.0 KiB
53 lines
2.0 KiB
<!DOCTYPE html>
|
|
|
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title></title>
|
|
<script src="https://cdn.goeasy.io/goeasy-2.11.1.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
|
|
var hostOjbect = window.chrome.webview.hostObjects.sync.qymsgcenter;
|
|
var userString = hostOjbect.GetUserString();
|
|
alert(userString);
|
|
//let goeasy = GoEasy.getInstance({
|
|
// host: "hangzhou.goeasy.io", //若是新加坡区域:singapore.goeasy.io
|
|
// appkey: "BC-652c4236c6ba4083b026e8cfa2e199b1",
|
|
// modules: ['pubsub']//根据需要,传入‘pubsub’或'im’,或数组方式同时传入
|
|
//});
|
|
|
|
////建立连接
|
|
//goeasy.connect({
|
|
// onSuccess: function () { //连接成功
|
|
// console.log("GoEasy connect successfully.") //连接成功
|
|
// subscribe();
|
|
// },
|
|
// onFailed: function (error) { //连接失败
|
|
// console.log("Failed to connect GoEasy, code:" + error.code + ",error:" + error.content);
|
|
// },
|
|
// onProgress: function (attempts) { //连接或自动重连中
|
|
// console.log("GoEasy is connecting", attempts);
|
|
// }
|
|
//});
|
|
|
|
//function subscribe() {
|
|
// var pubsub = goeasy.pubsub;
|
|
// pubsub.subscribe({
|
|
// channel: "my_channel",//替换为您自己的channel
|
|
// onMessage: function (message) {
|
|
// //收到消息
|
|
// console.log("Channel:" + message.channel + " content:" + message.content);
|
|
// },
|
|
// onSuccess: function () {
|
|
// console.log("Channel订阅成功。");
|
|
// },
|
|
// onFailed: function (error) {
|
|
// console.log("Channel订阅失败, 错误编码:" + error.code + " 错误信息:" + error.content)
|
|
// }
|
|
// });
|
|
//}
|
|
</script>
|
|
</body>
|
|
</html>
|