import SDK from "./Easemob-chat-4.0.7.js"; // 3.0sdk const install = (Vue, vm) => { //实例化SDK对象 const WebIM = SDK; WebIM.conn = new WebIM.connection({ appKey: "1132230508163855#demo", https: true, //是否使用HTTPS url: "wss://im-api-wechat.easecdn.com/websocket", // socket server (3.0 SDK) apiUrl: "https://a1.easecdn.com", // rest server heartBeatWait: 30000, //心跳间隔 autoReconnectNumMax: 5, //自动重连次数 useOwnUploadFun: false, // 是否使用自己的上传方式(如将图片文件等上传到自己的服务器,构建消息时只传url) delivery:true }); Vue.prototype.$WebIM = WebIM } export default { install }