集成融云1
This commit is contained in:
118
App.vue
118
App.vue
@@ -1,72 +1,72 @@
|
||||
<script setup lang="ts">
|
||||
// #ifdef APP-PLUS
|
||||
import { setSdkLanguageFromSystem } from '@/uni_modules/tuikit-atomic-x/utils/setSdkLanguageFromSystem'
|
||||
// #endif
|
||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||
import { reLaunch } from './utils/router'
|
||||
import { useAuthUser } from './composables/useAuthUser'
|
||||
import { useUserStore } from './stores/user'
|
||||
import { TUIChatKit } from './TUIKit'
|
||||
import { getIpBlack } from './api'
|
||||
// #ifdef APP-PLUS
|
||||
import { setSdkLanguageFromSystem } from '@/uni_modules/tuikit-atomic-x/utils/setSdkLanguageFromSystem'
|
||||
// #endif
|
||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||
import { reLaunch } from './utils/router'
|
||||
import { useAuthUser } from './composables/useAuthUser'
|
||||
import { useUserStore } from './stores/user'
|
||||
import { TUIChatKit } from './TUIKit'
|
||||
import { getIpBlack } from './api'
|
||||
|
||||
TUIChatKit.init()
|
||||
TUIChatKit.init()
|
||||
|
||||
const { token, tencentUserSig } = useAuthUser()
|
||||
const { loginTencentIM } = useUserStore()
|
||||
/** 静默登录逻辑 */
|
||||
const silentLogin = async (e: any) => {
|
||||
if (token.value) {
|
||||
loginTencentIM()
|
||||
// reLaunch('/TUIKit/components/TUIConversation/index')
|
||||
return
|
||||
}
|
||||
const { token, tencentUserSig } = useAuthUser()
|
||||
const { loginTencentIM } = useUserStore()
|
||||
/** 静默登录逻辑 */
|
||||
const silentLogin = async (e : any) => {
|
||||
if (token.value) {
|
||||
loginTencentIM()
|
||||
// reLaunch('/TUIKit/components/TUIConversation/index')
|
||||
return
|
||||
}
|
||||
|
||||
console.log(tencentUserSig, '=====222==')
|
||||
if (e?.query?.invitationCode) {
|
||||
reLaunch('/pages/login/phone-register/phone-register', {
|
||||
invitationCode: e.query.invitationCode
|
||||
})
|
||||
} else {
|
||||
// 没有token去登录页
|
||||
reLaunch('/pages/login/login')
|
||||
}
|
||||
}
|
||||
console.log(tencentUserSig, '=====222==')
|
||||
if (e?.query?.invitationCode) {
|
||||
reLaunch('/pages/login/phone-register/phone-register', {
|
||||
invitationCode: e.query.invitationCode
|
||||
})
|
||||
} else {
|
||||
// 没有token去登录页
|
||||
reLaunch('/pages/login/login')
|
||||
}
|
||||
}
|
||||
|
||||
onLaunch((e: any) => {
|
||||
// return
|
||||
console.log('App Launch111')
|
||||
silentLogin(e)
|
||||
onLaunch((e : any) => {
|
||||
// return
|
||||
console.log('App Launch111')
|
||||
silentLogin(e)
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
setSdkLanguageFromSystem()
|
||||
// #endif
|
||||
})
|
||||
// #ifdef APP-PLUS
|
||||
setSdkLanguageFromSystem()
|
||||
// #endif
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
console.log('App Show222')
|
||||
})
|
||||
onShow(() => {
|
||||
console.log('App Show222')
|
||||
})
|
||||
|
||||
onHide(async () => {
|
||||
if (token.value) {
|
||||
const show = await getIpBlack(false)
|
||||
console.log(show.data.data, '======')
|
||||
}
|
||||
onHide(async () => {
|
||||
if (token.value) {
|
||||
const show = await getIpBlack(false)
|
||||
console.log(show.data.data, '======')
|
||||
}
|
||||
|
||||
console.log('App Hide333')
|
||||
})
|
||||
console.log('App Hide333')
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/*每个页面公共css */
|
||||
@import './styles/global.scss';
|
||||
/*每个页面公共css */
|
||||
@import './styles/global.scss';
|
||||
|
||||
/* common css for page */
|
||||
// uni-page-body,
|
||||
// html,
|
||||
// body,
|
||||
// page {
|
||||
// width: 100% !important;
|
||||
// height: 100% !important;
|
||||
// overflow: hidden;
|
||||
// }
|
||||
</style>
|
||||
/* common css for page */
|
||||
// uni-page-body,
|
||||
// html,
|
||||
// body,
|
||||
// page {
|
||||
// width: 100% !important;
|
||||
// height: 100% !important;
|
||||
// overflow: hidden;
|
||||
// }
|
||||
</style>
|
||||
Reference in New Issue
Block a user