18 lines
625 B
JavaScript
18 lines
625 B
JavaScript
import { appConfig } from '@/config';
|
|
import { HttpImClient } from './httpImClient';
|
|
import { LongConnectionImClient } from './longConnectionImClient';
|
|
|
|
class UnsupportedWildfireImClient {
|
|
constructor() {
|
|
throw new Error('当前本地社区版 Web 客户端未启用 WildFire Web SDK');
|
|
}
|
|
}
|
|
|
|
export const imClient = appConfig.sdkMode === 'wildfire'
|
|
? new UnsupportedWildfireImClient()
|
|
: appConfig.sdkMode === 'custom-ws' || appConfig.sdkMode === 'long'
|
|
? new LongConnectionImClient()
|
|
: new HttpImClient();
|
|
|
|
export { HttpImClient, LongConnectionImClient, UnsupportedWildfireImClient as WildfireImClient };
|