This commit is contained in:
36
App.vue
36
App.vue
@@ -1,7 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup>
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import { setSdkLanguageFromSystem } from '@/uni_modules/tuikit-atomic-x/utils/setSdkLanguageFromSystem'
|
import { setSdkLanguageFromSystem } from '@/uni_modules/tuikit-atomic-x/utils/setSdkLanguageFromSystem'
|
||||||
// import * as call from "@/uni_modules/RongCloud-CallWrapper/lib/index"
|
// 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
|
// #endif
|
||||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||||
import { reLaunch } from './utils/router'
|
import { reLaunch } from './utils/router'
|
||||||
@@ -17,7 +22,7 @@
|
|||||||
const { token, tencentUserSig } = useAuthUser()
|
const { token, tencentUserSig } = useAuthUser()
|
||||||
const { loginTencentIM } = useUserStore()
|
const { loginTencentIM } = useUserStore()
|
||||||
/** 静默登录逻辑 */
|
/** 静默登录逻辑 */
|
||||||
const silentLogin = async (e : any) => {
|
const silentLogin = async (e) => {
|
||||||
if (token.value) {
|
if (token.value) {
|
||||||
loginTencentIM()
|
loginTencentIM()
|
||||||
// reLaunch('/TUIKit/components/TUIConversation/index')
|
// 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
|
// return
|
||||||
console.log('App Launch111')
|
console.log('App Launch111')
|
||||||
silentLogin(e)
|
silentLogin(e)
|
||||||
@@ -44,6 +69,11 @@
|
|||||||
setSdkLanguageFromSystem()
|
setSdkLanguageFromSystem()
|
||||||
// onAllListeners()
|
// onAllListeners()
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
iniCall()
|
||||||
|
// #endif
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user