web im 注册 返回错误 type:27 求解 版本1.1.2
附近里有页面代码和加载文件 打印输出的错误 和配置文件详细信息 如需其他信息请留言 我会补充 求解答 谢谢! demo是按官网的1.1.1的web im 注册demo代码写的 下面是配置:
WebIM.config = {
/*
* XMPP server
*/
xmppURL: 'im-api.easemob.com',
/*
* Backend REST API URL
*/
apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com',
/*
* Application AppKey
*/
appkey: 'hehualong#websns',
/*
* Whether to use HTTPS
* @parameter {Boolean} true or false
*/
https: '',
/*
* isMultiLoginSessions
* true: A visitor can sign in to multiple webpages and receive messages at all the webpages.
* false: A visitor can sign in to only one webpage and receive messages at the webpage.
*/
isMultiLoginSessions: false,
/*
* Set to auto sign-in
*/
isAutoLogin: true
};
WebIM.config = {
/*
* XMPP server
*/
xmppURL: 'im-api.easemob.com',
/*
* Backend REST API URL
*/
apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com',
/*
* Application AppKey
*/
appkey: 'hehualong#websns',
/*
* Whether to use HTTPS
* @parameter {Boolean} true or false
*/
https: '',
/*
* isMultiLoginSessions
* true: A visitor can sign in to multiple webpages and receive messages at all the webpages.
* false: A visitor can sign in to only one webpage and receive messages at the webpage.
*/
isMultiLoginSessions: false,
/*
* Set to auto sign-in
*/
isAutoLogin: true
};
没有找到相关结果
已邀请:
2 个回复
beyond - imgeek运营
关于webim api错误码详细对照可以在这里看到http://docs.easemob.com/im/450errorcode/40weberrorcode
现在来看这个错误,WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR在 sdk定义的是appkey错误或者没写。
根据用户名/密码/昵称注册环信 Web IM:
var options = {
username: "username",
password: "password",
nickname: "nickname",
appKey: "orgName#appName",
success: function () { },
error: function () { },
apiUrl: WebIM.config.apiURL
};
WebIM.utils.registerUser(options);
你少写了一个appkey!
如果我 回复帮到了你,欢迎赞赏!
zhaokui525
username:userName,password:usrPwd,nickname:nickName,appKey:WebIM.config.appkey,
success:function(e){console.log('regist success!---'+ JSON.stringify(e) );},
error:function(e){console.log('regist error ---'+ JSON.stringify(e));},
apiUrl:WebIM.config.apiURL
};
conn.registerUser(选项);
}
我的注册,返回错误代码27,登录也是一样的,,什么情况啊, 该如何解决啊,,谢谢啦 。