This commit is contained in:
36
App.vue
36
App.vue
@@ -1,7 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
// #ifdef APP-PLUS
|
||||
import { setSdkLanguageFromSystem } from '@/uni_modules/tuikit-atomic-x/utils/setSdkLanguageFromSystem'
|
||||
// import * as call from "@/uni_modules/RongCloud-CallWrapper/lib/index"
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
import * as RongIMLib from '@rongcloud/imlib-next';
|
||||
import { installer as rtcInstaller } from '@rongcloud/plugin-rtc';
|
||||
import { installer as callPlusInstaller } from '@rongcloud/plugin-call-plus';
|
||||
// #endif
|
||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||
import { reLaunch } from './utils/router'
|
||||
@@ -17,7 +22,7 @@
|
||||
const { token, tencentUserSig } = useAuthUser()
|
||||
const { loginTencentIM } = useUserStore()
|
||||
/** 静默登录逻辑 */
|
||||
const silentLogin = async (e : any) => {
|
||||
const silentLogin = async (e) => {
|
||||
if (token.value) {
|
||||
loginTencentIM()
|
||||
// reLaunch('/TUIKit/components/TUIConversation/index')
|
||||
@@ -35,7 +40,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
onLaunch((e : any) => {
|
||||
/** 初始化 H5 音视频通话 */
|
||||
const iniCall = () => {
|
||||
// IM 初始化
|
||||
RongIMLib.init({
|
||||
appkey: '<Your-Appkey>',
|
||||
});
|
||||
|
||||
// RTC 初始化
|
||||
const rtcClient = RongIMLib.installPlugin(rtcInstaller, {});
|
||||
|
||||
// CallPlus 初始化
|
||||
const callPlusClient = RongIMLib.installPlugin(callPlusInstaller, {
|
||||
rtcClient
|
||||
});
|
||||
|
||||
|
||||
|
||||
console.log('====1111111111=====', callPlusClient)
|
||||
}
|
||||
|
||||
onLaunch((e) => {
|
||||
// return
|
||||
console.log('App Launch111')
|
||||
silentLogin(e)
|
||||
@@ -44,6 +69,11 @@
|
||||
setSdkLanguageFromSystem()
|
||||
// onAllListeners()
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
iniCall()
|
||||
// #endif
|
||||
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
|
||||
Reference in New Issue
Block a user