var config = {
/*
* XMPP server
*/
xmppURL: getUrl().xmppUrl,
/*
* Backend REST API URL
*/
apiURL: getUrl().apiUrl,
/*
* Application AppKey
*/
// appkey:"1108200216113219#9kdoctor",
// appkey: "easemob-demo#chatdemoui",
appkey: "1174170405178871#online",
/*
* Application Host
*/
Host: "easemob.com",
/*
* Whether to use HTTPS
* @parameter {Boolean} true or false
*/
https: true,
isHttpDNS: false,
/*
* 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: true,
/**
* Whether to use window.doQuery()
* @parameter {Boolean} true or false
*/
isWindowSDK: false,
/**
* isSandBox=true: xmppURL: 'im-api.sandbox.easemob.com', apiURL: '//a1.sdb.easemob.com',
* isSandBox=false: xmppURL: 'im-api.easemob.com', apiURL: '//a1.easemob.com',
* @parameter {Boolean} true or false
*/
isSandBox: false,
/**
* Whether to console.log in strophe.log()
* @parameter {Boolean} true or false
*/
isDebug: true,
/**
* Whether to show logs in strophe
* @parameter {Boolean} true or false
*/
isStropheLog: false,
/**
* will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.
* won't auto connect if autoReconnectNumMax=0.
*/
autoReconnectNumMax: 5,
/**
* the interval secons between each atuo reconnectting.
* works only if autoReconnectMaxNum >= 2.
*/
autoReconnectInterval: 2,
/**
* webrtc supports WebKit and https only
*/
isWebRTC: true,//window.RTCPeerConnection && /^https\:$/.test(window.location.protocol),
/**
* cn: chinese
* us: english
*/
i18n: "us",
/*
* Set to auto sign-in
*/
isAutoLogin: true,
/**
* Size of message cache for person to person
*/
p2pMessageCacheSize: 500,
/**
* When a message arrived, the receiver send an ack message to the
* sender, in order to tell the sender the message has delivered.
* See call back function onReceivedMessage
*/
delivery: true,
/**
* Size of message cache for group chating like group, chatroom etc
*/
groupMessageCacheSize: 200,
/**
* 5 actual logging methods, ordered and available:
* 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR'
*/
loglevel: "ERROR",
/**
* enable localstorage for history messages
*/
enableLocalStorage: true
}
export default config
8 个回复
宫商角徵羽
宫商角徵羽
lizg - ……
宫商角徵羽
lizg - ……
你发的这个是链接的请求截图,你重新发下,需要看看你的配置
宫商角徵羽
宫商角徵羽
var apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1.easemob.com"
var xmppUrl = "//im-api-v2.easemob.com/ws"
if(window.location.href.indexOf("www.test.com") !== -1 ){
apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1.easemob.com"
xmppUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//im-api-v2.easemob.com/ws"
}
else if(window.location.href.indexOf("172.17.1.95") !== -1){
apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1.easemob.com"
xmppUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//im-api-v2.easemob.com/ws"
}
else if(window.location.href.indexOf("localhost") !== -1){
apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1.easemob.com"
xmppUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//im-api-v2.easemob.com/ws"
}
return {
apiUrl: apiUrl,
xmppUrl: xmppUrl
}
}
var config = {
/*
* XMPP server
*/
xmppURL: getUrl().xmppUrl,
/*
* Backend REST API URL
*/
apiURL: getUrl().apiUrl,
/*
* Application AppKey
*/
// appkey:"1108200216113219#9kdoctor",
// appkey: "easemob-demo#chatdemoui",
appkey: "1174170405178871#online",
/*
* Application Host
*/
Host: "easemob.com",
/*
* Whether to use HTTPS
* @parameter {Boolean} true or false
*/
https: true,
isHttpDNS: false,
/*
* 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: true,
/**
* Whether to use window.doQuery()
* @parameter {Boolean} true or false
*/
isWindowSDK: false,
/**
* isSandBox=true: xmppURL: 'im-api.sandbox.easemob.com', apiURL: '//a1.sdb.easemob.com',
* isSandBox=false: xmppURL: 'im-api.easemob.com', apiURL: '//a1.easemob.com',
* @parameter {Boolean} true or false
*/
isSandBox: false,
/**
* Whether to console.log in strophe.log()
* @parameter {Boolean} true or false
*/
isDebug: true,
/**
* Whether to show logs in strophe
* @parameter {Boolean} true or false
*/
isStropheLog: false,
/**
* will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.
* won't auto connect if autoReconnectNumMax=0.
*/
autoReconnectNumMax: 5,
/**
* the interval secons between each atuo reconnectting.
* works only if autoReconnectMaxNum >= 2.
*/
autoReconnectInterval: 2,
/**
* webrtc supports WebKit and https only
*/
isWebRTC: true,//window.RTCPeerConnection && /^https\:$/.test(window.location.protocol),
/**
* cn: chinese
* us: english
*/
i18n: "us",
/*
* Set to auto sign-in
*/
isAutoLogin: true,
/**
* Size of message cache for person to person
*/
p2pMessageCacheSize: 500,
/**
* When a message arrived, the receiver send an ack message to the
* sender, in order to tell the sender the message has delivered.
* See call back function onReceivedMessage
*/
delivery: true,
/**
* Size of message cache for group chating like group, chatroom etc
*/
groupMessageCacheSize: 200,
/**
* 5 actual logging methods, ordered and available:
* 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR'
*/
loglevel: "ERROR",
/**
* enable localstorage for history messages
*/
enableLocalStorage: true
}
export default config
lizg - ……
apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1.easemob.com"
xmppUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//im-api-v2.easemob.com/ws"