私有云 SDK 集成配置

小于 1 分钟

私有云 SDK 集成配置

Web Vue 3 Demo

对于 Web Vue 3 Demo,进行私有化配置需在 Vue 3 Demo 源代码open in new window中进行修改。

修改环境配置

src/IM/config/index.js 文件中,进行如下修改:

//环信appKey默认配置项
export const DEFAULT_EASEMOB_APPKEY = 'easemob#easeim';// 私有化的 App Key
export const DEFAULT_EASEMOB_SOCKET_URL = 'http://im-api-v2.easemob.com/ws';//私有化的 WebSocket 地址
export const DEFAULT_EASEMOB_REST_URL = 'ws://a1.easemob.com';//私有化的 RESTful 服务器地址

Web React Demo

对于 Web React Demo,进行私有化配置需在 React Demo 源代码open in new window中进行修改。

修改配置如下:

  1. easemob-demo-react/src/App.tsx 中修改配置信息,如下所示:
		initConfig={{
  		  appKey: 'easemob#easeim',// 私有化的 App Key
        isHttpDNS: false,//固定false
        restUrl:'http://a1.easemob.com',//私有化的 RESTful 服务器地址
        msyncUrl: 'ws://im-api-v2.easemob.com/ws',//私有化的 WebSocket 地址
		    useUserInfo: true,
        translationTargetLanguage: state.translationTargetLanguage,
      }}
上次编辑于: